diff --git a/.changelog/95191f0d1ce44022aa8cc3ff1871bbb2.json b/.changelog/95191f0d1ce44022aa8cc3ff1871bbb2.json new file mode 100644 index 00000000000..f0c02705a61 --- /dev/null +++ b/.changelog/95191f0d1ce44022aa8cc3ff1871bbb2.json @@ -0,0 +1,409 @@ +{ + "id": "95191f0d-1ce4-4022-aa8c-c3ff1871bbb2", + "type": "bugfix", + "collapse": true, + "description": "Add assurance test for operation order.", + "modules": [ + "service/accessanalyzer", + "service/account", + "service/acm", + "service/acmpca", + "service/amp", + "service/amplify", + "service/amplifybackend", + "service/amplifyuibuilder", + "service/apigateway", + "service/apigatewaymanagementapi", + "service/apigatewayv2", + "service/appconfig", + "service/appconfigdata", + "service/appfabric", + "service/appflow", + "service/appintegrations", + "service/applicationautoscaling", + "service/applicationcostprofiler", + "service/applicationdiscoveryservice", + "service/applicationinsights", + "service/applicationsignals", + "service/appmesh", + "service/apprunner", + "service/appstream", + "service/appsync", + "service/apptest", + "service/arczonalshift", + "service/artifact", + "service/athena", + "service/auditmanager", + "service/autoscaling", + "service/autoscalingplans", + "service/b2bi", + "service/backup", + "service/backupgateway", + "service/backupsearch", + "service/batch", + "service/bcmdataexports", + "service/bcmpricingcalculator", + "service/bedrock", + "service/bedrockagent", + "service/bedrockagentruntime", + "service/bedrockdataautomation", + "service/bedrockdataautomationruntime", + "service/bedrockruntime", + "service/billing", + "service/billingconductor", + "service/braket", + "service/budgets", + "service/chatbot", + "service/chime", + "service/chimesdkidentity", + "service/chimesdkmediapipelines", + "service/chimesdkmeetings", + "service/chimesdkmessaging", + "service/chimesdkvoice", + "service/cleanrooms", + "service/cleanroomsml", + "service/cloud9", + "service/cloudcontrol", + "service/clouddirectory", + "service/cloudformation", + "service/cloudfront", + "service/cloudfrontkeyvaluestore", + "service/cloudhsm", + "service/cloudhsmv2", + "service/cloudsearch", + "service/cloudsearchdomain", + "service/cloudtrail", + "service/cloudtraildata", + "service/cloudwatch", + "service/cloudwatchevents", + "service/cloudwatchlogs", + "service/codeartifact", + "service/codebuild", + "service/codecatalyst", + "service/codecommit", + "service/codeconnections", + "service/codedeploy", + "service/codeguruprofiler", + "service/codegurureviewer", + "service/codegurusecurity", + "service/codepipeline", + "service/codestarconnections", + "service/codestarnotifications", + "service/cognitoidentity", + "service/cognitoidentityprovider", + "service/cognitosync", + "service/comprehend", + "service/comprehendmedical", + "service/computeoptimizer", + "service/configservice", + "service/connect", + "service/connectcampaigns", + "service/connectcampaignsv2", + "service/connectcases", + "service/connectcontactlens", + "service/connectparticipant", + "service/controlcatalog", + "service/controltower", + "service/costandusagereportservice", + "service/costexplorer", + "service/costoptimizationhub", + "service/customerprofiles", + "service/databasemigrationservice", + "service/databrew", + "service/dataexchange", + "service/datapipeline", + "service/datasync", + "service/datazone", + "service/dax", + "service/deadline", + "service/detective", + "service/devicefarm", + "service/devopsguru", + "service/directconnect", + "service/directoryservice", + "service/directoryservicedata", + "service/dlm", + "service/docdb", + "service/docdbelastic", + "service/drs", + "service/dsql", + "service/dynamodb", + "service/dynamodbstreams", + "service/ebs", + "service/ec2", + "service/ec2instanceconnect", + "service/ecr", + "service/ecrpublic", + "service/ecs", + "service/efs", + "service/eks", + "service/eksauth", + "service/elasticache", + "service/elasticbeanstalk", + "service/elasticloadbalancing", + "service/elasticloadbalancingv2", + "service/elasticsearchservice", + "service/elastictranscoder", + "service/emr", + "service/emrcontainers", + "service/emrserverless", + "service/entityresolution", + "service/eventbridge", + "service/evidently", + "service/finspace", + "service/finspacedata", + "service/firehose", + "service/fis", + "service/fms", + "service/forecast", + "service/forecastquery", + "service/frauddetector", + "service/freetier", + "service/fsx", + "service/gamelift", + "service/geomaps", + "service/geoplaces", + "service/georoutes", + "service/glacier", + "service/globalaccelerator", + "service/glue", + "service/grafana", + "service/greengrass", + "service/greengrassv2", + "service/groundstation", + "service/guardduty", + "service/health", + "service/healthlake", + "service/iam", + "service/identitystore", + "service/imagebuilder", + "service/inspector", + "service/inspector2", + "service/inspectorscan", + "service/internetmonitor", + "service/invoicing", + "service/iot", + "service/iotanalytics", + "service/iotdataplane", + "service/iotdeviceadvisor", + "service/iotevents", + "service/ioteventsdata", + "service/iotfleethub", + "service/iotfleetwise", + "service/iotjobsdataplane", + "service/iotsecuretunneling", + "service/iotsitewise", + "service/iotthingsgraph", + "service/iottwinmaker", + "service/iotwireless", + "service/ivs", + "service/ivschat", + "service/ivsrealtime", + "service/kafka", + "service/kafkaconnect", + "service/kendra", + "service/kendraranking", + "service/keyspaces", + "service/kinesis", + "service/kinesisanalytics", + "service/kinesisanalyticsv2", + "service/kinesisvideo", + "service/kinesisvideoarchivedmedia", + "service/kinesisvideomedia", + "service/kinesisvideosignaling", + "service/kinesisvideowebrtcstorage", + "service/kms", + "service/lakeformation", + "service/lambda", + "service/launchwizard", + "service/lexmodelbuildingservice", + "service/lexmodelsv2", + "service/lexruntimeservice", + "service/lexruntimev2", + "service/licensemanager", + "service/licensemanagerlinuxsubscriptions", + "service/licensemanagerusersubscriptions", + "service/lightsail", + "service/location", + "service/lookoutequipment", + "service/lookoutmetrics", + "service/lookoutvision", + "service/m2", + "service/machinelearning", + "service/macie2", + "service/mailmanager", + "service/managedblockchain", + "service/managedblockchainquery", + "service/marketplaceagreement", + "service/marketplacecatalog", + "service/marketplacecommerceanalytics", + "service/marketplacedeployment", + "service/marketplaceentitlementservice", + "service/marketplacemetering", + "service/marketplacereporting", + "service/mediaconnect", + "service/mediaconvert", + "service/medialive", + "service/mediapackage", + "service/mediapackagev2", + "service/mediapackagevod", + "service/mediastore", + "service/mediastoredata", + "service/mediatailor", + "service/medicalimaging", + "service/memorydb", + "service/mgn", + "service/migrationhub", + "service/migrationhubconfig", + "service/migrationhuborchestrator", + "service/migrationhubrefactorspaces", + "service/migrationhubstrategy", + "service/mq", + "service/mturk", + "service/mwaa", + "service/neptune", + "service/neptunedata", + "service/neptunegraph", + "service/networkfirewall", + "service/networkflowmonitor", + "service/networkmanager", + "service/networkmonitor", + "service/notifications", + "service/notificationscontacts", + "service/oam", + "service/observabilityadmin", + "service/omics", + "service/opensearch", + "service/opensearchserverless", + "service/opsworks", + "service/opsworkscm", + "service/organizations", + "service/osis", + "service/outposts", + "service/panorama", + "service/partnercentralselling", + "service/paymentcryptography", + "service/paymentcryptographydata", + "service/pcaconnectorad", + "service/pcaconnectorscep", + "service/pcs", + "service/personalize", + "service/personalizeevents", + "service/personalizeruntime", + "service/pi", + "service/pinpoint", + "service/pinpointemail", + "service/pinpointsmsvoice", + "service/pinpointsmsvoicev2", + "service/pipes", + "service/polly", + "service/pricing", + "service/privatenetworks", + "service/proton", + "service/qapps", + "service/qbusiness", + "service/qconnect", + "service/qldb", + "service/qldbsession", + "service/quicksight", + "service/ram", + "service/rbin", + "service/rds", + "service/rdsdata", + "service/redshift", + "service/redshiftdata", + "service/redshiftserverless", + "service/rekognition", + "service/repostspace", + "service/resiliencehub", + "service/resourceexplorer2", + "service/resourcegroups", + "service/resourcegroupstaggingapi", + "service/robomaker", + "service/rolesanywhere", + "service/route53", + "service/route53domains", + "service/route53profiles", + "service/route53recoverycluster", + "service/route53recoverycontrolconfig", + "service/route53recoveryreadiness", + "service/route53resolver", + "service/rum", + "service/s3", + "service/s3control", + "service/s3outposts", + "service/s3tables", + "service/sagemaker", + "service/sagemakera2iruntime", + "service/sagemakeredge", + "service/sagemakerfeaturestoreruntime", + "service/sagemakergeospatial", + "service/sagemakermetrics", + "service/sagemakerruntime", + "service/savingsplans", + "service/scheduler", + "service/schemas", + "service/secretsmanager", + "service/securityhub", + "service/securityir", + "service/securitylake", + "service/serverlessapplicationrepository", + "service/servicecatalog", + "service/servicecatalogappregistry", + "service/servicediscovery", + "service/servicequotas", + "service/ses", + "service/sesv2", + "service/sfn", + "service/shield", + "service/signer", + "service/simspaceweaver", + "service/sms", + "service/snowball", + "service/snowdevicemanagement", + "service/sns", + "service/socialmessaging", + "service/sqs", + "service/ssm", + "service/ssmcontacts", + "service/ssmincidents", + "service/ssmquicksetup", + "service/ssmsap", + "service/sso", + "service/ssoadmin", + "service/ssooidc", + "service/storagegateway", + "service/sts", + "service/supplychain", + "service/support", + "service/supportapp", + "service/swf", + "service/synthetics", + "service/taxsettings", + "service/textract", + "service/timestreaminfluxdb", + "service/timestreamquery", + "service/timestreamwrite", + "service/tnb", + "service/transcribe", + "service/transcribestreaming", + "service/transfer", + "service/translate", + "service/trustedadvisor", + "service/verifiedpermissions", + "service/voiceid", + "service/vpclattice", + "service/waf", + "service/wafregional", + "service/wafv2", + "service/wellarchitected", + "service/wisdom", + "service/workdocs", + "service/workmail", + "service/workmailmessageflow", + "service/workspaces", + "service/workspacesthinclient", + "service/workspacesweb", + "service/xray" + ] +} \ No newline at end of file diff --git a/SMITHY_GO_CODEGEN_VERSION b/SMITHY_GO_CODEGEN_VERSION index dca6972f85a..6b96ddfe817 100644 --- a/SMITHY_GO_CODEGEN_VERSION +++ b/SMITHY_GO_CODEGEN_VERSION @@ -1 +1 @@ -b5c304bb2a4b0306cb8de41bf2d842fe4e76eaf6 +af7d6d6b39cbb90e1dd09fcec8bc7c7e8883b2a9 diff --git a/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/SraOperationOrderTest.java b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/SraOperationOrderTest.java new file mode 100644 index 00000000000..915022e74c2 --- /dev/null +++ b/codegen/smithy-aws-go-codegen/src/main/java/software/amazon/smithy/aws/go/codegen/customization/SraOperationOrderTest.java @@ -0,0 +1,91 @@ +package software.amazon.smithy.aws.go.codegen.customization; + +import software.amazon.smithy.go.codegen.GoCodegenContext; +import software.amazon.smithy.go.codegen.GoWriter; +import software.amazon.smithy.go.codegen.SmithyGoDependency; +import software.amazon.smithy.go.codegen.integration.GoIntegration; +import software.amazon.smithy.model.knowledge.TopDownIndex; + +import static software.amazon.smithy.go.codegen.GoWriter.goTemplate; + +/** + * Validates that service client operations are performed in the orders specified by the Smithy Reference Architecture (SRA). + */ +public class SraOperationOrderTest implements GoIntegration { + @Override + public void writeAdditionalFiles(GoCodegenContext ctx) { + ctx.writerDelegator().useFileWriter("sra_operation_order_test.go", ctx.settings().getModuleName(), writer -> { + writer.write(renderCommonTestSource()); + + TopDownIndex.of(ctx.model()) + .getContainedOperations(ctx.settings().getService(ctx.model())) + .forEach(it -> { + var operationName = ctx.symbolProvider().toSymbol(it).getName(); + writer.write(renderTest(operationName)); + }); + }); + } + + private GoWriter.Writable renderCommonTestSource() { + return goTemplate(""" + $D $D + var errTestReturnEarly = errors.New("errTestReturnEarly") + + func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } + } + """, SmithyGoDependency.ERRORS, SmithyGoDependency.SMITHY_MIDDLEWARE); + } + + private GoWriter.Writable renderTest(String operationName) { + return goTemplate(""" + $1D $2D $3D $4D $5D $6D + func TestOp$7LSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.$7L(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\\nexpect: %v\\nactual: %v\\nall: %v", expect, actual, all) + } + } + """, + SmithyGoDependency.ERRORS, + SmithyGoDependency.TESTING, + SmithyGoDependency.CONTEXT, + SmithyGoDependency.STRINGS, + SmithyGoDependency.SLICES, + SmithyGoDependency.SMITHY_MIDDLEWARE, + operationName + ); + } +} diff --git a/codegen/smithy-aws-go-codegen/src/main/resources/META-INF/services/software.amazon.smithy.go.codegen.integration.GoIntegration b/codegen/smithy-aws-go-codegen/src/main/resources/META-INF/services/software.amazon.smithy.go.codegen.integration.GoIntegration index b2c700ed903..417f9e45c9d 100644 --- a/codegen/smithy-aws-go-codegen/src/main/resources/META-INF/services/software.amazon.smithy.go.codegen.integration.GoIntegration +++ b/codegen/smithy-aws-go-codegen/src/main/resources/META-INF/services/software.amazon.smithy.go.codegen.integration.GoIntegration @@ -90,3 +90,4 @@ software.amazon.smithy.aws.go.codegen.customization.BasicUserAgentFeatures software.amazon.smithy.aws.go.codegen.customization.ChecksumMetricsTracking software.amazon.smithy.aws.go.codegen.customization.AccountIdEndpointModeUserAgent software.amazon.smithy.aws.go.codegen.CredentialSourceFeatureTrackerGenerator +software.amazon.smithy.aws.go.codegen.customization.SraOperationOrderTest \ No newline at end of file diff --git a/internal/kitchensinktest/generated.json b/internal/kitchensinktest/generated.json index 1cf4e3ea12e..2577fc490ec 100644 --- a/internal/kitchensinktest/generated.json +++ b/internal/kitchensinktest/generated.json @@ -23,6 +23,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/errors.go", "types/types.go", "validators.go" diff --git a/internal/kitchensinktest/sra_operation_order_test.go b/internal/kitchensinktest/sra_operation_order_test.go new file mode 100644 index 00000000000..32003d64cff --- /dev/null +++ b/internal/kitchensinktest/sra_operation_order_test.go @@ -0,0 +1,56 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package kitchensinktest + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpGetItemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetItem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/internal/protocoltest/awsrestjson/generated.json b/internal/protocoltest/awsrestjson/generated.json index 2dd136bf37d..bd84d2038ee 100644 --- a/internal/protocoltest/awsrestjson/generated.json +++ b/internal/protocoltest/awsrestjson/generated.json @@ -199,6 +199,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/internal/protocoltest/awsrestjson/sra_operation_order_test.go b/internal/protocoltest/awsrestjson/sra_operation_order_test.go new file mode 100644 index 00000000000..c98cb92c4f4 --- /dev/null +++ b/internal/protocoltest/awsrestjson/sra_operation_order_test.go @@ -0,0 +1,3661 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package awsrestjson + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAllQueryStringTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AllQueryStringTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpConstantAndVariableQueryStringSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ConstantAndVariableQueryString(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpConstantQueryStringSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ConstantQueryString(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpContentTypeParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ContentTypeParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDatetimeOffsetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DatetimeOffsets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDocumentTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DocumentType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDocumentTypeAsMapValueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DocumentTypeAsMapValue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDocumentTypeAsPayloadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DocumentTypeAsPayload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEmptyInputAndEmptyOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EmptyInputAndEmptyOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEndpointOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EndpointOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEndpointWithHostLabelOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EndpointWithHostLabelOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpFractionalSecondsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.FractionalSeconds(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGreetingWithErrorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GreetingWithErrors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHostWithPathOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HostWithPathOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpChecksumRequiredSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpChecksumRequired(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpEnumPayloadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpEnumPayload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpPayloadTraitsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpPayloadTraits(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpPayloadTraitsWithMediaTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpPayloadTraitsWithMediaType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpPayloadWithStructureSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpPayloadWithStructure(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpPayloadWithUnionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpPayloadWithUnion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpPrefixHeadersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpPrefixHeaders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpPrefixHeadersInResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpPrefixHeadersInResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpRequestWithFloatLabelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpRequestWithFloatLabels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpRequestWithGreedyLabelInPathSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpRequestWithGreedyLabelInPath(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpRequestWithLabelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpRequestWithLabels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpRequestWithLabelsAndTimestampFormatSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpRequestWithLabelsAndTimestampFormat(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpRequestWithRegexLiteralSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpRequestWithRegexLiteral(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpResponseCodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpResponseCode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpStringPayloadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpStringPayload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpIgnoreQueryParamsInResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.IgnoreQueryParamsInResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInputAndOutputWithHeadersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InputAndOutputWithHeaders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpJsonBlobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.JsonBlobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpJsonEnumsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.JsonEnums(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpJsonIntEnumsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.JsonIntEnums(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpJsonListsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.JsonLists(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpJsonMapsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.JsonMaps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpJsonTimestampsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.JsonTimestamps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpJsonUnionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.JsonUnions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedAcceptWithBodySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedAcceptWithBody(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedAcceptWithGenericStringSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedAcceptWithGenericString(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedAcceptWithPayloadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedAcceptWithPayload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedBlobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedBlob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedBooleanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedBoolean(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedByteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedByte(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedContentTypeWithBodySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedContentTypeWithBody(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedContentTypeWithGenericStringSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedContentTypeWithGenericString(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedContentTypeWithoutBodySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedContentTypeWithoutBody(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedContentTypeWithoutBodyEmptyInputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedContentTypeWithoutBodyEmptyInput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedContentTypeWithPayloadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedContentTypeWithPayload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedDoubleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedDouble(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedFloatSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedFloat(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedIntegerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedInteger(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedLongSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedLong(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedMapSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedMap(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedRequestBodySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedRequestBody(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedShortSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedShort(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedStringSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedString(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedTimestampBodyDateTimeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedTimestampBodyDateTime(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedTimestampBodyDefaultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedTimestampBodyDefault(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedTimestampBodyHttpDateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedTimestampBodyHttpDate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedTimestampHeaderDateTimeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedTimestampHeaderDateTime(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedTimestampHeaderDefaultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedTimestampHeaderDefault(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedTimestampHeaderEpochSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedTimestampHeaderEpoch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedTimestampPathDefaultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedTimestampPathDefault(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedTimestampPathEpochSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedTimestampPathEpoch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedTimestampPathHttpDateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedTimestampPathHttpDate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedTimestampQueryDefaultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedTimestampQueryDefault(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedTimestampQueryEpochSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedTimestampQueryEpoch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedTimestampQueryHttpDateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedTimestampQueryHttpDate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMalformedUnionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MalformedUnion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMediaTypeHeaderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MediaTypeHeader(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNoInputAndNoOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NoInputAndNoOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNoInputAndOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NoInputAndOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNullAndEmptyHeadersClientSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NullAndEmptyHeadersClient(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNullAndEmptyHeadersServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NullAndEmptyHeadersServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpOmitsNullSerializesEmptyStringSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.OmitsNullSerializesEmptyString(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpOmitsSerializingEmptyListsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.OmitsSerializingEmptyLists(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpOperationWithDefaultsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.OperationWithDefaults(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpOperationWithNestedStructureSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.OperationWithNestedStructure(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPostPlayerActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PostPlayerAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPostUnionWithJsonNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PostUnionWithJsonName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutWithContentEncodingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutWithContentEncoding(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpQueryIdempotencyTokenAutoFillSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.QueryIdempotencyTokenAutoFill(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpQueryParamsAsStringListMapSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.QueryParamsAsStringListMap(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpQueryPrecedenceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.QueryPrecedence(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRecursiveShapesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RecursiveShapes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResponseCodeHttpFallbackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResponseCodeHttpFallback(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResponseCodeRequiredSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResponseCodeRequired(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSimpleScalarPropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SimpleScalarProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSparseJsonListsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SparseJsonLists(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSparseJsonMapsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SparseJsonMaps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStreamingTraitsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StreamingTraits(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStreamingTraitsRequireLengthSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StreamingTraitsRequireLength(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStreamingTraitsWithMediaTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StreamingTraitsWithMediaType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestBodyStructureSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestBodyStructure(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestGetNoInputNoPayloadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestGetNoInputNoPayload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestGetNoPayloadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestGetNoPayload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestPayloadBlobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestPayloadBlob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestPayloadStructureSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestPayloadStructure(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestPostNoInputNoPayloadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestPostNoInputNoPayload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestPostNoPayloadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestPostNoPayload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTimestampFormatHeadersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TimestampFormatHeaders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUnitInputAndOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UnitInputAndOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/internal/protocoltest/ec2query/generated.json b/internal/protocoltest/ec2query/generated.json index 9ec59d4a4fa..6882d2a1566 100644 --- a/internal/protocoltest/ec2query/generated.json +++ b/internal/protocoltest/ec2query/generated.json @@ -71,6 +71,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/internal/protocoltest/ec2query/sra_operation_order_test.go b/internal/protocoltest/ec2query/sra_operation_order_test.go new file mode 100644 index 00000000000..5f54a81ceae --- /dev/null +++ b/internal/protocoltest/ec2query/sra_operation_order_test.go @@ -0,0 +1,896 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ec2query + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpDatetimeOffsetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DatetimeOffsets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEmptyInputAndEmptyOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EmptyInputAndEmptyOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEndpointOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EndpointOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEndpointWithHostLabelOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EndpointWithHostLabelOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpFractionalSecondsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.FractionalSeconds(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGreetingWithErrorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GreetingWithErrors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHostWithPathOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HostWithPathOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpIgnoresWrappingXmlNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.IgnoresWrappingXmlName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNestedStructuresSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NestedStructures(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNoInputAndOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NoInputAndOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutWithContentEncodingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutWithContentEncoding(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpQueryIdempotencyTokenAutoFillSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.QueryIdempotencyTokenAutoFill(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpQueryListsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.QueryLists(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpQueryTimestampsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.QueryTimestamps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRecursiveXmlShapesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RecursiveXmlShapes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSimpleInputParamsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SimpleInputParams(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSimpleScalarXmlPropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SimpleScalarXmlProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlBlobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlBlobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlEmptyBlobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlEmptyBlobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlEmptyListsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlEmptyLists(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlEnumsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlEnums(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlIntEnumsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlIntEnums(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlListsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlLists(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlNamespacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlNamespaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlTimestampsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlTimestamps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/internal/protocoltest/jsonrpc/generated.json b/internal/protocoltest/jsonrpc/generated.json index 2d3aae78c46..7cd84b38850 100644 --- a/internal/protocoltest/jsonrpc/generated.json +++ b/internal/protocoltest/jsonrpc/generated.json @@ -61,6 +61,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/internal/protocoltest/jsonrpc/sra_operation_order_test.go b/internal/protocoltest/jsonrpc/sra_operation_order_test.go new file mode 100644 index 00000000000..f09e3a57862 --- /dev/null +++ b/internal/protocoltest/jsonrpc/sra_operation_order_test.go @@ -0,0 +1,651 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package jsonrpc + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpContentTypeParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ContentTypeParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDatetimeOffsetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DatetimeOffsets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEmptyOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EmptyOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEndpointOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EndpointOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEndpointWithHostLabelOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EndpointWithHostLabelOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpFractionalSecondsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.FractionalSeconds(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGreetingWithErrorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GreetingWithErrors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHostWithPathOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HostWithPathOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpJsonEnumsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.JsonEnums(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpJsonIntEnumsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.JsonIntEnums(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpJsonUnionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.JsonUnions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpKitchenSinkOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.KitchenSinkOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNullOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NullOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpOperationWithOptionalInputOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.OperationWithOptionalInputOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAndGetInlineDocumentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAndGetInlineDocuments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutWithContentEncodingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutWithContentEncoding(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSimpleScalarPropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SimpleScalarProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSparseNullsOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SparseNullsOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/internal/protocoltest/jsonrpc10/generated.json b/internal/protocoltest/jsonrpc10/generated.json index 159151a7140..c6f633abce1 100644 --- a/internal/protocoltest/jsonrpc10/generated.json +++ b/internal/protocoltest/jsonrpc10/generated.json @@ -55,6 +55,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/internal/protocoltest/jsonrpc10/sra_operation_order_test.go b/internal/protocoltest/jsonrpc10/sra_operation_order_test.go new file mode 100644 index 00000000000..62a652cca78 --- /dev/null +++ b/internal/protocoltest/jsonrpc10/sra_operation_order_test.go @@ -0,0 +1,546 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package jsonrpc10 + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpContentTypeParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ContentTypeParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEmptyInputAndEmptyOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EmptyInputAndEmptyOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEndpointOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EndpointOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEndpointWithHostLabelOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EndpointWithHostLabelOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGreetingWithErrorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GreetingWithErrors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHostWithPathOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HostWithPathOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpJsonUnionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.JsonUnions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNoInputAndNoOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NoInputAndNoOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNoInputAndOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NoInputAndOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpOperationWithDefaultsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.OperationWithDefaults(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpOperationWithNestedStructureSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.OperationWithNestedStructure(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpOperationWithRequiredMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.OperationWithRequiredMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpOperationWithRequiredMembersWithDefaultsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.OperationWithRequiredMembersWithDefaults(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutWithContentEncodingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutWithContentEncoding(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSimpleScalarPropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SimpleScalarProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/internal/protocoltest/query/generated.json b/internal/protocoltest/query/generated.json index bb09f4a63a7..b44e0161297 100644 --- a/internal/protocoltest/query/generated.json +++ b/internal/protocoltest/query/generated.json @@ -87,6 +87,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/internal/protocoltest/query/sra_operation_order_test.go b/internal/protocoltest/query/sra_operation_order_test.go new file mode 100644 index 00000000000..a7f41eff103 --- /dev/null +++ b/internal/protocoltest/query/sra_operation_order_test.go @@ -0,0 +1,1176 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package query + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpDatetimeOffsetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DatetimeOffsets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEmptyInputAndEmptyOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EmptyInputAndEmptyOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEndpointOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EndpointOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEndpointWithHostLabelOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EndpointWithHostLabelOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpFlattenedXmlMapSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.FlattenedXmlMap(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpFlattenedXmlMapWithXmlNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.FlattenedXmlMapWithXmlName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpFlattenedXmlMapWithXmlNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.FlattenedXmlMapWithXmlNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpFractionalSecondsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.FractionalSeconds(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGreetingWithErrorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GreetingWithErrors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHostWithPathOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HostWithPathOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpIgnoresWrappingXmlNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.IgnoresWrappingXmlName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNestedStructuresSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NestedStructures(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNoInputAndNoOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NoInputAndNoOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNoInputAndOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NoInputAndOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutWithContentEncodingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutWithContentEncoding(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpQueryIdempotencyTokenAutoFillSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.QueryIdempotencyTokenAutoFill(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpQueryListsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.QueryLists(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpQueryMapsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.QueryMaps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpQueryTimestampsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.QueryTimestamps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRecursiveXmlShapesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RecursiveXmlShapes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSimpleInputParamsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SimpleInputParams(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSimpleScalarXmlPropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SimpleScalarXmlProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlBlobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlBlobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlEmptyBlobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlEmptyBlobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlEmptyListsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlEmptyLists(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlEmptyMapsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlEmptyMaps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlEnumsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlEnums(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlIntEnumsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlIntEnums(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlListsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlLists(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlMapsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlMaps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlMapsXmlNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlMapsXmlName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlNamespacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlNamespaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlTimestampsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlTimestamps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/internal/protocoltest/restxml/generated.json b/internal/protocoltest/restxml/generated.json index cad69563b00..ca20e10665b 100644 --- a/internal/protocoltest/restxml/generated.json +++ b/internal/protocoltest/restxml/generated.json @@ -146,6 +146,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/internal/protocoltest/restxml/sra_operation_order_test.go b/internal/protocoltest/restxml/sra_operation_order_test.go new file mode 100644 index 00000000000..f850d9a1ff8 --- /dev/null +++ b/internal/protocoltest/restxml/sra_operation_order_test.go @@ -0,0 +1,2226 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package restxml + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAllQueryStringTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AllQueryStringTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBodyWithXmlNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BodyWithXmlName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpConstantAndVariableQueryStringSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ConstantAndVariableQueryString(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpConstantQueryStringSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ConstantQueryString(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpContentTypeParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ContentTypeParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDatetimeOffsetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DatetimeOffsets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEmptyInputAndEmptyOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EmptyInputAndEmptyOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEndpointOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EndpointOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEndpointWithHostLabelHeaderOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EndpointWithHostLabelHeaderOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEndpointWithHostLabelOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EndpointWithHostLabelOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpFlattenedXmlMapSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.FlattenedXmlMap(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpFlattenedXmlMapWithXmlNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.FlattenedXmlMapWithXmlName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpFlattenedXmlMapWithXmlNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.FlattenedXmlMapWithXmlNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpFractionalSecondsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.FractionalSeconds(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGreetingWithErrorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GreetingWithErrors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpEnumPayloadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpEnumPayload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpPayloadTraitsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpPayloadTraits(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpPayloadTraitsWithMediaTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpPayloadTraitsWithMediaType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpPayloadWithMemberXmlNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpPayloadWithMemberXmlName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpPayloadWithStructureSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpPayloadWithStructure(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpPayloadWithUnionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpPayloadWithUnion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpPayloadWithXmlNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpPayloadWithXmlName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpPayloadWithXmlNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpPayloadWithXmlNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpPayloadWithXmlNamespaceAndPrefixSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpPayloadWithXmlNamespaceAndPrefix(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpPrefixHeadersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpPrefixHeaders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpRequestWithFloatLabelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpRequestWithFloatLabels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpRequestWithGreedyLabelInPathSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpRequestWithGreedyLabelInPath(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpRequestWithLabelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpRequestWithLabels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpRequestWithLabelsAndTimestampFormatSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpRequestWithLabelsAndTimestampFormat(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpResponseCodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpResponseCode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHttpStringPayloadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HttpStringPayload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpIgnoreQueryParamsInResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.IgnoreQueryParamsInResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInputAndOutputWithHeadersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InputAndOutputWithHeaders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNestedXmlMapsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NestedXmlMaps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNestedXmlMapWithXmlNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NestedXmlMapWithXmlName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNoInputAndNoOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NoInputAndNoOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNoInputAndOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NoInputAndOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNullAndEmptyHeadersClientSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NullAndEmptyHeadersClient(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNullAndEmptyHeadersServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NullAndEmptyHeadersServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpOmitsNullSerializesEmptyStringSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.OmitsNullSerializesEmptyString(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutWithContentEncodingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutWithContentEncoding(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpQueryIdempotencyTokenAutoFillSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.QueryIdempotencyTokenAutoFill(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpQueryParamsAsStringListMapSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.QueryParamsAsStringListMap(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpQueryPrecedenceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.QueryPrecedence(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRecursiveShapesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RecursiveShapes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSimpleScalarPropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SimpleScalarProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTimestampFormatHeadersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TimestampFormatHeaders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlAttributesOnPayloadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlAttributesOnPayload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlBlobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlBlobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlEmptyBlobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlEmptyBlobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlEmptyListsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlEmptyLists(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlEmptyMapsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlEmptyMaps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlEmptyStringsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlEmptyStrings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlEnumsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlEnums(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlIntEnumsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlIntEnums(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlListsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlLists(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlMapsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlMaps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlMapsXmlNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlMapsXmlName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlMapWithXmlNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlMapWithXmlNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlNamespacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlNamespaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlTimestampsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlTimestamps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpXmlUnionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.XmlUnions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/internal/protocoltest/restxmlwithnamespace/generated.json b/internal/protocoltest/restxmlwithnamespace/generated.json index 5251380654b..60e8cd02864 100644 --- a/internal/protocoltest/restxmlwithnamespace/generated.json +++ b/internal/protocoltest/restxmlwithnamespace/generated.json @@ -23,6 +23,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/types.go", "validators.go" ], diff --git a/internal/protocoltest/restxmlwithnamespace/sra_operation_order_test.go b/internal/protocoltest/restxmlwithnamespace/sra_operation_order_test.go new file mode 100644 index 00000000000..d4009827da6 --- /dev/null +++ b/internal/protocoltest/restxmlwithnamespace/sra_operation_order_test.go @@ -0,0 +1,56 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package restxmlwithnamespace + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpSimpleScalarPropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SimpleScalarProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/internal/protocoltest/smithyrpcv2cbor/generated.json b/internal/protocoltest/smithyrpcv2cbor/generated.json index 094ff56e236..86a7e372c93 100644 --- a/internal/protocoltest/smithyrpcv2cbor/generated.json +++ b/internal/protocoltest/smithyrpcv2cbor/generated.json @@ -47,6 +47,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/internal/protocoltest/smithyrpcv2cbor/sra_operation_order_test.go b/internal/protocoltest/smithyrpcv2cbor/sra_operation_order_test.go new file mode 100644 index 00000000000..4f5d2c69c62 --- /dev/null +++ b/internal/protocoltest/smithyrpcv2cbor/sra_operation_order_test.go @@ -0,0 +1,476 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package smithyrpcv2cbor + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpEmptyInputOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EmptyInputOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpFloat16SRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Float16(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpFractionalSecondsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.FractionalSeconds(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGreetingWithErrorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GreetingWithErrors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNoInputOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NoInputOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpOperationWithDefaultsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.OperationWithDefaults(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpOptionalInputOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.OptionalInputOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRecursiveShapesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RecursiveShapes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRpcV2CborDenseMapsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RpcV2CborDenseMaps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRpcV2CborListsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RpcV2CborLists(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRpcV2CborSparseMapsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RpcV2CborSparseMaps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSimpleScalarPropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SimpleScalarProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSparseNullsOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SparseNullsOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/accessanalyzer/generated.json b/service/accessanalyzer/generated.json index 65a20d495b5..0b1592eb649 100644 --- a/service/accessanalyzer/generated.json +++ b/service/accessanalyzer/generated.json @@ -58,6 +58,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/accessanalyzer/sra_operation_order_test.go b/service/accessanalyzer/sra_operation_order_test.go new file mode 100644 index 00000000000..02e6e4004a3 --- /dev/null +++ b/service/accessanalyzer/sra_operation_order_test.go @@ -0,0 +1,1316 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package accessanalyzer + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpApplyArchiveRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ApplyArchiveRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelPolicyGenerationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelPolicyGeneration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCheckAccessNotGrantedSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CheckAccessNotGranted(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCheckNoNewAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CheckNoNewAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCheckNoPublicAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CheckNoPublicAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAccessPreviewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAccessPreview(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAnalyzerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAnalyzer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateArchiveRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateArchiveRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAnalyzerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAnalyzer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteArchiveRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteArchiveRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGenerateFindingRecommendationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GenerateFindingRecommendation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccessPreviewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccessPreview(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAnalyzedResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAnalyzedResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAnalyzerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAnalyzer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetArchiveRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetArchiveRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFindingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFinding(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFindingRecommendationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFindingRecommendation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFindingsStatisticsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFindingsStatistics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFindingV2SRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFindingV2(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGeneratedPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGeneratedPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccessPreviewFindingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccessPreviewFindings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccessPreviewsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccessPreviews(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAnalyzedResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAnalyzedResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAnalyzersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAnalyzers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListArchiveRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListArchiveRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFindingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFindings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFindingsV2SRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFindingsV2(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPolicyGenerationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPolicyGenerations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartPolicyGenerationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartPolicyGeneration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartResourceScanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartResourceScan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAnalyzerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAnalyzer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateArchiveRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateArchiveRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFindingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFindings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpValidatePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ValidatePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/account/generated.json b/service/account/generated.json index faf6ce4cf04..dc869e0e6e2 100644 --- a/service/account/generated.json +++ b/service/account/generated.json @@ -33,6 +33,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/account/sra_operation_order_test.go b/service/account/sra_operation_order_test.go new file mode 100644 index 00000000000..7f869aa41fc --- /dev/null +++ b/service/account/sra_operation_order_test.go @@ -0,0 +1,441 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package account + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcceptPrimaryEmailUpdateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptPrimaryEmailUpdate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAlternateContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAlternateContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableRegionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableRegion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableRegionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableRegion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAlternateContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAlternateContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetContactInformationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetContactInformation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPrimaryEmailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPrimaryEmail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRegionOptStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRegionOptStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRegionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRegions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAlternateContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAlternateContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutContactInformationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutContactInformation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartPrimaryEmailUpdateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartPrimaryEmailUpdate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/acm/generated.json b/service/acm/generated.json index 4328a56e6de..6658af71994 100644 --- a/service/acm/generated.json +++ b/service/acm/generated.json @@ -36,6 +36,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/acm/sra_operation_order_test.go b/service/acm/sra_operation_order_test.go new file mode 100644 index 00000000000..9e5df0713d9 --- /dev/null +++ b/service/acm/sra_operation_order_test.go @@ -0,0 +1,546 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package acm + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddTagsToCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddTagsToCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccountConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccountConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCertificatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCertificates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAccountConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAccountConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveTagsFromCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveTagsFromCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRenewCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RenewCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRequestCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RequestCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResendValidationEmailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResendValidationEmail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCertificateOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCertificateOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/acmpca/generated.json b/service/acmpca/generated.json index 5ddd56ccbc2..b76e106f5ee 100644 --- a/service/acmpca/generated.json +++ b/service/acmpca/generated.json @@ -44,6 +44,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/acmpca/sra_operation_order_test.go b/service/acmpca/sra_operation_order_test.go new file mode 100644 index 00000000000..87d340acec5 --- /dev/null +++ b/service/acmpca/sra_operation_order_test.go @@ -0,0 +1,826 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package acmpca + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateCertificateAuthoritySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCertificateAuthority(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCertificateAuthorityAuditReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCertificateAuthorityAuditReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCertificateAuthoritySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCertificateAuthority(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCertificateAuthoritySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCertificateAuthority(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCertificateAuthorityAuditReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCertificateAuthorityAuditReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCertificateAuthorityCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCertificateAuthorityCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCertificateAuthorityCsrSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCertificateAuthorityCsr(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportCertificateAuthorityCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportCertificateAuthorityCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpIssueCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.IssueCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCertificateAuthoritiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCertificateAuthorities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreCertificateAuthoritySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreCertificateAuthority(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRevokeCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RevokeCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagCertificateAuthoritySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagCertificateAuthority(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagCertificateAuthoritySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagCertificateAuthority(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCertificateAuthoritySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCertificateAuthority(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/amp/generated.json b/service/amp/generated.json index 8fc0b999b47..9be43be9286 100644 --- a/service/amp/generated.json +++ b/service/amp/generated.json @@ -48,6 +48,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/amp/sra_operation_order_test.go b/service/amp/sra_operation_order_test.go new file mode 100644 index 00000000000..bbac7794d3d --- /dev/null +++ b/service/amp/sra_operation_order_test.go @@ -0,0 +1,966 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package amp + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateAlertManagerDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAlertManagerDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLoggingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLoggingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRuleGroupsNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRuleGroupsNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateScraperSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateScraper(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorkspaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorkspace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAlertManagerDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAlertManagerDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLoggingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLoggingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRuleGroupsNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRuleGroupsNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteScraperSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteScraper(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWorkspaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWorkspace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAlertManagerDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAlertManagerDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLoggingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLoggingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRuleGroupsNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRuleGroupsNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeScraperSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeScraper(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWorkspaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWorkspace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDefaultScraperConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDefaultScraperConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRuleGroupsNamespacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRuleGroupsNamespaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListScrapersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListScrapers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkspacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkspaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAlertManagerDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAlertManagerDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRuleGroupsNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRuleGroupsNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLoggingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLoggingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateScraperSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateScraper(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWorkspaceAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWorkspaceAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/amplify/generated.json b/service/amplify/generated.json index 403d95ad389..b903da42d0d 100644 --- a/service/amplify/generated.json +++ b/service/amplify/generated.json @@ -58,6 +58,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/amplify/sra_operation_order_test.go b/service/amplify/sra_operation_order_test.go new file mode 100644 index 00000000000..ac17691834e --- /dev/null +++ b/service/amplify/sra_operation_order_test.go @@ -0,0 +1,1316 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package amplify + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBackendEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBackendEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBranchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBranch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDomainAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDomainAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWebhookSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWebhook(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBackendEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBackendEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBranchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBranch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDomainAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDomainAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWebhookSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWebhook(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGenerateAccessLogsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GenerateAccessLogs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetArtifactUrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetArtifactUrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBackendEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBackendEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBranchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBranch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDomainAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDomainAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWebhookSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWebhook(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAppsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListArtifactsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListArtifacts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBackendEnvironmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBackendEnvironments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBranchesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBranches(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDomainAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDomainAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWebhooksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWebhooks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBranchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBranch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDomainAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDomainAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWebhookSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWebhook(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/amplifybackend/generated.json b/service/amplifybackend/generated.json index 274e83b78fd..ee22d98f0c1 100644 --- a/service/amplifybackend/generated.json +++ b/service/amplifybackend/generated.json @@ -52,6 +52,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/amplifybackend/sra_operation_order_test.go b/service/amplifybackend/sra_operation_order_test.go new file mode 100644 index 00000000000..24534eb3e11 --- /dev/null +++ b/service/amplifybackend/sra_operation_order_test.go @@ -0,0 +1,1106 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package amplifybackend + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCloneBackendSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CloneBackend(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBackendSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBackend(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBackendAPISRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBackendAPI(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBackendAuthSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBackendAuth(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBackendConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBackendConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBackendStorageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBackendStorage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBackendSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBackend(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBackendAPISRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBackendAPI(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBackendAuthSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBackendAuth(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBackendStorageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBackendStorage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGenerateBackendAPIModelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GenerateBackendAPIModels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBackendSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBackend(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBackendAPISRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBackendAPI(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBackendAPIModelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBackendAPIModels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBackendAuthSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBackendAuth(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBackendJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBackendJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBackendStorageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBackendStorage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportBackendAuthSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportBackendAuth(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportBackendStorageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportBackendStorage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBackendJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBackendJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListS3BucketsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListS3Buckets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveAllBackendsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveAllBackends(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveBackendConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveBackendConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBackendAPISRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBackendAPI(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBackendAuthSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBackendAuth(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBackendConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBackendConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBackendJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBackendJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBackendStorageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBackendStorage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/amplifyuibuilder/generated.json b/service/amplifyuibuilder/generated.json index 608becfbf89..740857eef70 100644 --- a/service/amplifyuibuilder/generated.json +++ b/service/amplifyuibuilder/generated.json @@ -49,6 +49,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/amplifyuibuilder/sra_operation_order_test.go b/service/amplifyuibuilder/sra_operation_order_test.go new file mode 100644 index 00000000000..b48ee3fb3fc --- /dev/null +++ b/service/amplifyuibuilder/sra_operation_order_test.go @@ -0,0 +1,1001 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package amplifyuibuilder + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFormSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateForm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateThemeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTheme(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFormSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteForm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteThemeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTheme(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExchangeCodeForTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExchangeCodeForToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportComponentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportComponents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportFormsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportForms(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportThemesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportThemes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCodegenJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCodegenJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFormSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetForm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetThemeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTheme(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCodegenJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCodegenJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListComponentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListComponents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFormsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListForms(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListThemesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListThemes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutMetadataFlagSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutMetadataFlag(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRefreshTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RefreshToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartCodegenJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartCodegenJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFormSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateForm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateThemeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTheme(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/apigateway/generated.json b/service/apigateway/generated.json index 498b2c82825..25530ae3cc5 100644 --- a/service/apigateway/generated.json +++ b/service/apigateway/generated.json @@ -145,6 +145,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/apigateway/sra_operation_order_test.go b/service/apigateway/sra_operation_order_test.go new file mode 100644 index 00000000000..4eeded2f04c --- /dev/null +++ b/service/apigateway/sra_operation_order_test.go @@ -0,0 +1,4361 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package apigateway + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateApiKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApiKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAuthorizerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAuthorizer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBasePathMappingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBasePathMapping(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDocumentationPartSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDocumentationPart(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDocumentationVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDocumentationVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDomainNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDomainName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDomainNameAccessAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDomainNameAccessAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRequestValidatorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRequestValidator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRestApiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRestApi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUsagePlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUsagePlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUsagePlanKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUsagePlanKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVpcLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVpcLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApiKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApiKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAuthorizerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAuthorizer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBasePathMappingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBasePathMapping(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteClientCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteClientCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDocumentationPartSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDocumentationPart(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDocumentationVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDocumentationVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDomainNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDomainName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDomainNameAccessAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDomainNameAccessAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGatewayResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGatewayResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIntegrationResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIntegrationResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMethodSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMethod(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMethodResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMethodResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRequestValidatorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRequestValidator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRestApiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRestApi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteStageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteStage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUsagePlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUsagePlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUsagePlanKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUsagePlanKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVpcLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVpcLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpFlushStageAuthorizersCacheSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.FlushStageAuthorizersCache(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpFlushStageCacheSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.FlushStageCache(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGenerateClientCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GenerateClientCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApiKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApiKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApiKeysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApiKeys(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAuthorizerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAuthorizer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAuthorizersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAuthorizers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBasePathMappingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBasePathMapping(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBasePathMappingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBasePathMappings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetClientCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetClientCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetClientCertificatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetClientCertificates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeploymentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeployments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDocumentationPartSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDocumentationPart(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDocumentationPartsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDocumentationParts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDocumentationVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDocumentationVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDocumentationVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDocumentationVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDomainNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDomainName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDomainNameAccessAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDomainNameAccessAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDomainNamesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDomainNames(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGatewayResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGatewayResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGatewayResponsesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGatewayResponses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIntegrationResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIntegrationResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMethodSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMethod(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMethodResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMethodResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetModelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetModels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetModelTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetModelTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRequestValidatorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRequestValidator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRequestValidatorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRequestValidators(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRestApiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRestApi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRestApisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRestApis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSdkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSdk(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSdkTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSdkType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSdkTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSdkTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUsageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUsage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUsagePlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUsagePlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUsagePlanKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUsagePlanKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUsagePlanKeysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUsagePlanKeys(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUsagePlansSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUsagePlans(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVpcLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVpcLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVpcLinksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVpcLinks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportApiKeysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportApiKeys(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportDocumentationPartsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportDocumentationParts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportRestApiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportRestApi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutGatewayResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutGatewayResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutIntegrationResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutIntegrationResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutMethodSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutMethod(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutMethodResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutMethodResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRestApiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRestApi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRejectDomainNameAccessAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RejectDomainNameAccessAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestInvokeAuthorizerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestInvokeAuthorizer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestInvokeMethodSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestInvokeMethod(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApiKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApiKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAuthorizerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAuthorizer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBasePathMappingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBasePathMapping(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateClientCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateClientCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDocumentationPartSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDocumentationPart(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDocumentationVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDocumentationVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDomainNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDomainName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGatewayResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGatewayResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIntegrationResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIntegrationResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMethodSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMethod(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMethodResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMethodResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRequestValidatorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRequestValidator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRestApiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRestApi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateStageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateStage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUsageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUsage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUsagePlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUsagePlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVpcLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVpcLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/apigatewaymanagementapi/generated.json b/service/apigatewaymanagementapi/generated.json index a825946b575..d3c8629480d 100644 --- a/service/apigatewaymanagementapi/generated.json +++ b/service/apigatewaymanagementapi/generated.json @@ -24,6 +24,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/errors.go", "types/types.go", "validators.go" diff --git a/service/apigatewaymanagementapi/sra_operation_order_test.go b/service/apigatewaymanagementapi/sra_operation_order_test.go new file mode 100644 index 00000000000..d8c5eca0feb --- /dev/null +++ b/service/apigatewaymanagementapi/sra_operation_order_test.go @@ -0,0 +1,126 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package apigatewaymanagementapi + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpDeleteConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPostToConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PostToConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/apigatewayv2/generated.json b/service/apigatewayv2/generated.json index 361ed8e867b..06ba606e06e 100644 --- a/service/apigatewayv2/generated.json +++ b/service/apigatewayv2/generated.json @@ -93,6 +93,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/apigatewayv2/sra_operation_order_test.go b/service/apigatewayv2/sra_operation_order_test.go new file mode 100644 index 00000000000..5745c05f0b6 --- /dev/null +++ b/service/apigatewayv2/sra_operation_order_test.go @@ -0,0 +1,2541 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package apigatewayv2 + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateApiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateApiMappingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApiMapping(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAuthorizerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAuthorizer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDomainNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDomainName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIntegrationResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIntegrationResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRouteResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRouteResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVpcLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVpcLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccessLogSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccessLogSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApiMappingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApiMapping(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAuthorizerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAuthorizer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCorsConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCorsConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDomainNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDomainName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIntegrationResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIntegrationResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRouteRequestParameterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRouteRequestParameter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRouteResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRouteResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRouteSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRouteSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteStageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteStage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVpcLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVpcLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportApiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportApi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApiMappingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApiMapping(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApiMappingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApiMappings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAuthorizerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAuthorizer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAuthorizersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAuthorizers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeploymentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeployments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDomainNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDomainName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDomainNamesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDomainNames(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIntegrationResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIntegrationResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIntegrationResponsesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIntegrationResponses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIntegrationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIntegrations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetModelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetModels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetModelTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetModelTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRouteResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRouteResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRouteResponsesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRouteResponses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRoutesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRoutes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVpcLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVpcLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVpcLinksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVpcLinks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportApiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportApi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReimportApiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReimportApi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetAuthorizersCacheSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetAuthorizersCache(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApiMappingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApiMapping(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAuthorizerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAuthorizer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDomainNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDomainName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIntegrationResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIntegrationResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRouteResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRouteResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateStageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateStage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVpcLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVpcLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/appconfig/generated.json b/service/appconfig/generated.json index 702207fdd78..6c9cc64c518 100644 --- a/service/appconfig/generated.json +++ b/service/appconfig/generated.json @@ -66,6 +66,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/appconfig/sra_operation_order_test.go b/service/appconfig/sra_operation_order_test.go new file mode 100644 index 00000000000..5618ff46850 --- /dev/null +++ b/service/appconfig/sra_operation_order_test.go @@ -0,0 +1,1596 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appconfig + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConfigurationProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConfigurationProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDeploymentStrategySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDeploymentStrategy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateExtensionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateExtension(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateExtensionAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateExtensionAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateHostedConfigurationVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateHostedConfigurationVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConfigurationProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConfigurationProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDeploymentStrategySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDeploymentStrategy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteExtensionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteExtension(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteExtensionAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteExtensionAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteHostedConfigurationVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteHostedConfigurationVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccountSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccountSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConfigurationProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConfigurationProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeploymentStrategySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeploymentStrategy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetExtensionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetExtension(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetExtensionAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetExtensionAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetHostedConfigurationVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetHostedConfigurationVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConfigurationProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConfigurationProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDeploymentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDeployments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDeploymentStrategiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDeploymentStrategies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEnvironmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEnvironments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListExtensionAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListExtensionAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListExtensionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListExtensions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListHostedConfigurationVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListHostedConfigurationVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAccountSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAccountSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConfigurationProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConfigurationProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDeploymentStrategySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDeploymentStrategy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateExtensionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateExtension(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateExtensionAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateExtensionAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpValidateConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ValidateConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/appconfigdata/generated.json b/service/appconfigdata/generated.json index 2a0a55c5d48..84602c87f43 100644 --- a/service/appconfigdata/generated.json +++ b/service/appconfigdata/generated.json @@ -23,6 +23,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/appconfigdata/sra_operation_order_test.go b/service/appconfigdata/sra_operation_order_test.go new file mode 100644 index 00000000000..322ce5e068b --- /dev/null +++ b/service/appconfigdata/sra_operation_order_test.go @@ -0,0 +1,91 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appconfigdata + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpGetLatestConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLatestConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartConfigurationSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartConfigurationSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/appfabric/generated.json b/service/appfabric/generated.json index 8d0813c8159..49d58096057 100644 --- a/service/appfabric/generated.json +++ b/service/appfabric/generated.json @@ -47,6 +47,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/appfabric/sra_operation_order_test.go b/service/appfabric/sra_operation_order_test.go new file mode 100644 index 00000000000..e1dd0f76b3f --- /dev/null +++ b/service/appfabric/sra_operation_order_test.go @@ -0,0 +1,931 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appfabric + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchGetUserAccessTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetUserAccessTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpConnectAppAuthorizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ConnectAppAuthorization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAppAuthorizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAppAuthorization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAppBundleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAppBundle(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIngestionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIngestion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIngestionDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIngestionDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAppAuthorizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAppAuthorization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAppBundleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAppBundle(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIngestionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIngestion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIngestionDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIngestionDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAppAuthorizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAppAuthorization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAppBundleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAppBundle(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIngestionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIngestion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIngestionDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIngestionDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAppAuthorizationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAppAuthorizations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAppBundlesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAppBundles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIngestionDestinationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIngestionDestinations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIngestionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIngestions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartIngestionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartIngestion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartUserAccessTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartUserAccessTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopIngestionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopIngestion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAppAuthorizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAppAuthorization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIngestionDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIngestionDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/appflow/generated.json b/service/appflow/generated.json index 98fd4088f9f..77fed9df094 100644 --- a/service/appflow/generated.json +++ b/service/appflow/generated.json @@ -46,6 +46,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/appflow/sra_operation_order_test.go b/service/appflow/sra_operation_order_test.go new file mode 100644 index 00000000000..07752c82bb3 --- /dev/null +++ b/service/appflow/sra_operation_order_test.go @@ -0,0 +1,896 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appflow + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCancelFlowExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelFlowExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConnectorProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConnectorProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConnectorProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConnectorProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConnectorEntitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConnectorEntity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConnectorProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConnectorProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConnectorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConnectors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFlowExecutionRecordsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFlowExecutionRecords(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConnectorEntitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConnectorEntities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConnectorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConnectors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFlowsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFlows(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetConnectorMetadataCacheSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetConnectorMetadataCache(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUnregisterConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UnregisterConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConnectorProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConnectorProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConnectorRegistrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConnectorRegistration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/appintegrations/generated.json b/service/appintegrations/generated.json index b926b174c1b..5419dc311e1 100644 --- a/service/appintegrations/generated.json +++ b/service/appintegrations/generated.json @@ -44,6 +44,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/appintegrations/sra_operation_order_test.go b/service/appintegrations/sra_operation_order_test.go new file mode 100644 index 00000000000..b58b854b42c --- /dev/null +++ b/service/appintegrations/sra_operation_order_test.go @@ -0,0 +1,826 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appintegrations + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataIntegrationAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataIntegrationAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEventIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEventIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEventIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEventIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEventIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEventIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplicationAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataIntegrationAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataIntegrationAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataIntegrationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataIntegrations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEventIntegrationAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEventIntegrationAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEventIntegrationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEventIntegrations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDataIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDataIntegrationAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataIntegrationAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEventIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEventIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/applicationautoscaling/generated.json b/service/applicationautoscaling/generated.json index f01d3921680..81b19eda6eb 100644 --- a/service/applicationautoscaling/generated.json +++ b/service/applicationautoscaling/generated.json @@ -35,6 +35,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/applicationautoscaling/sra_operation_order_test.go b/service/applicationautoscaling/sra_operation_order_test.go new file mode 100644 index 00000000000..ec57fef02af --- /dev/null +++ b/service/applicationautoscaling/sra_operation_order_test.go @@ -0,0 +1,511 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package applicationautoscaling + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpDeleteScalingPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteScalingPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteScheduledActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteScheduledAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterScalableTargetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterScalableTarget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeScalableTargetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeScalableTargets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeScalingActivitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeScalingActivities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeScalingPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeScalingPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeScheduledActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeScheduledActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPredictiveScalingForecastSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPredictiveScalingForecast(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutScalingPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutScalingPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutScheduledActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutScheduledAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterScalableTargetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterScalableTarget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/applicationcostprofiler/generated.json b/service/applicationcostprofiler/generated.json index a69c53c7f67..901b3af3f91 100644 --- a/service/applicationcostprofiler/generated.json +++ b/service/applicationcostprofiler/generated.json @@ -27,6 +27,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/applicationcostprofiler/sra_operation_order_test.go b/service/applicationcostprofiler/sra_operation_order_test.go new file mode 100644 index 00000000000..efdcd6e0f70 --- /dev/null +++ b/service/applicationcostprofiler/sra_operation_order_test.go @@ -0,0 +1,231 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package applicationcostprofiler + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpDeleteReportDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteReportDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReportDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReportDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportApplicationUsageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportApplicationUsage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReportDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReportDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutReportDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutReportDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateReportDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateReportDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/applicationdiscoveryservice/generated.json b/service/applicationdiscoveryservice/generated.json index 699580ff200..1b291353e73 100644 --- a/service/applicationdiscoveryservice/generated.json +++ b/service/applicationdiscoveryservice/generated.json @@ -49,6 +49,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/applicationdiscoveryservice/sra_operation_order_test.go b/service/applicationdiscoveryservice/sra_operation_order_test.go new file mode 100644 index 00000000000..d64f38d6849 --- /dev/null +++ b/service/applicationdiscoveryservice/sra_operation_order_test.go @@ -0,0 +1,1001 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package applicationdiscoveryservice + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateConfigurationItemsToApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateConfigurationItemsToApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeleteAgentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteAgents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeleteImportDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteImportData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAgentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAgents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBatchDeleteConfigurationTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBatchDeleteConfigurationTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeContinuousExportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeContinuousExports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeExportConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeExportConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeExportTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeExportTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeImportTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeImportTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateConfigurationItemsFromApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateConfigurationItemsFromApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDiscoverySummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDiscoverySummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServerNeighborsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServerNeighbors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartBatchDeleteConfigurationTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartBatchDeleteConfigurationTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartContinuousExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartContinuousExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDataCollectionByAgentIdsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDataCollectionByAgentIds(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartExportTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartExportTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartImportTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartImportTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopContinuousExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopContinuousExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopDataCollectionByAgentIdsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopDataCollectionByAgentIds(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/applicationinsights/generated.json b/service/applicationinsights/generated.json index 54e99648f1b..28ea143c63e 100644 --- a/service/applicationinsights/generated.json +++ b/service/applicationinsights/generated.json @@ -54,6 +54,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/applicationinsights/sra_operation_order_test.go b/service/applicationinsights/sra_operation_order_test.go new file mode 100644 index 00000000000..c2c0b84e2b9 --- /dev/null +++ b/service/applicationinsights/sra_operation_order_test.go @@ -0,0 +1,1176 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package applicationinsights + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddWorkloadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddWorkload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLogPatternSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLogPattern(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLogPatternSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLogPattern(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeComponentConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeComponentConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeComponentConfigurationRecommendationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeComponentConfigurationRecommendation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLogPatternSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLogPattern(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeObservationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeObservation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeProblemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeProblem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeProblemObservationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeProblemObservations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWorkloadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWorkload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListComponentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListComponents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConfigurationHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConfigurationHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLogPatternsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLogPatterns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLogPatternSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLogPatternSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProblemsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProblems(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkloadsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkloads(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveWorkloadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveWorkload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateComponentConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateComponentConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLogPatternSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLogPattern(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProblemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProblem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWorkloadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWorkload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/applicationsignals/generated.json b/service/applicationsignals/generated.json index c5183e55333..d95368c90aa 100644 --- a/service/applicationsignals/generated.json +++ b/service/applicationsignals/generated.json @@ -36,6 +36,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/applicationsignals/sra_operation_order_test.go b/service/applicationsignals/sra_operation_order_test.go new file mode 100644 index 00000000000..fe448a5c0cd --- /dev/null +++ b/service/applicationsignals/sra_operation_order_test.go @@ -0,0 +1,546 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package applicationsignals + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchGetServiceLevelObjectiveBudgetReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetServiceLevelObjectiveBudgetReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateServiceLevelObjectiveSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateServiceLevelObjective(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteServiceLevelObjectiveSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteServiceLevelObjective(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceLevelObjectiveSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServiceLevelObjective(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServiceDependenciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServiceDependencies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServiceDependentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServiceDependents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServiceLevelObjectivesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServiceLevelObjectives(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServiceOperationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServiceOperations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDiscoverySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDiscovery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateServiceLevelObjectiveSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateServiceLevelObjective(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/appmesh/generated.json b/service/appmesh/generated.json index eab73ce0c1a..808c4f98ea4 100644 --- a/service/appmesh/generated.json +++ b/service/appmesh/generated.json @@ -59,6 +59,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/appmesh/sra_operation_order_test.go b/service/appmesh/sra_operation_order_test.go new file mode 100644 index 00000000000..2587c3c1fed --- /dev/null +++ b/service/appmesh/sra_operation_order_test.go @@ -0,0 +1,1351 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appmesh + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateGatewayRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGatewayRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMeshSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMesh(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVirtualGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVirtualGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVirtualNodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVirtualNode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVirtualRouterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVirtualRouter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVirtualServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVirtualService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGatewayRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGatewayRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMeshSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMesh(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVirtualGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVirtualGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVirtualNodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVirtualNode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVirtualRouterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVirtualRouter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVirtualServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVirtualService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGatewayRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGatewayRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMeshSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMesh(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVirtualGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVirtualGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVirtualNodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVirtualNode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVirtualRouterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVirtualRouter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVirtualServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVirtualService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGatewayRoutesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGatewayRoutes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMeshesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMeshes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRoutesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRoutes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVirtualGatewaysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVirtualGateways(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVirtualNodesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVirtualNodes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVirtualRoutersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVirtualRouters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVirtualServicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVirtualServices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGatewayRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGatewayRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMeshSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMesh(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVirtualGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVirtualGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVirtualNodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVirtualNode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVirtualRouterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVirtualRouter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVirtualServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVirtualService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/apprunner/generated.json b/service/apprunner/generated.json index 08b8e5a559b..ee6893a02ec 100644 --- a/service/apprunner/generated.json +++ b/service/apprunner/generated.json @@ -58,6 +58,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/apprunner/sra_operation_order_test.go b/service/apprunner/sra_operation_order_test.go new file mode 100644 index 00000000000..a3c0e21f4f1 --- /dev/null +++ b/service/apprunner/sra_operation_order_test.go @@ -0,0 +1,1316 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package apprunner + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateCustomDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateCustomDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAutoScalingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAutoScalingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateObservabilityConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateObservabilityConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVpcConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVpcConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVpcIngressConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVpcIngressConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAutoScalingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAutoScalingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteObservabilityConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteObservabilityConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVpcConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVpcConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVpcIngressConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVpcIngressConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAutoScalingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAutoScalingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCustomDomainsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCustomDomains(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeObservabilityConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeObservabilityConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVpcConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVpcConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVpcIngressConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVpcIngressConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateCustomDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateCustomDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAutoScalingConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAutoScalingConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConnectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConnections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListObservabilityConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListObservabilityConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOperationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOperations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServicesForAutoScalingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServicesForAutoScalingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVpcConnectorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVpcConnectors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVpcIngressConnectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVpcIngressConnections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPauseServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PauseService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResumeServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResumeService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDefaultAutoScalingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDefaultAutoScalingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVpcIngressConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVpcIngressConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/appstream/generated.json b/service/appstream/generated.json index 77450031f7d..ceb5098c3b7 100644 --- a/service/appstream/generated.json +++ b/service/appstream/generated.json @@ -100,6 +100,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/appstream/sra_operation_order_test.go b/service/appstream/sra_operation_order_test.go new file mode 100644 index 00000000000..c86b852397d --- /dev/null +++ b/service/appstream/sra_operation_order_test.go @@ -0,0 +1,2786 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appstream + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateAppBlockBuilderAppBlockSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateAppBlockBuilderAppBlock(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateApplicationFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateApplicationFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateApplicationToEntitlementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateApplicationToEntitlement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchAssociateUserStackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchAssociateUserStack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDisassociateUserStackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDisassociateUserStack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCopyImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopyImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAppBlockSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAppBlock(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAppBlockBuilderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAppBlockBuilder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAppBlockBuilderStreamingURLSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAppBlockBuilderStreamingURL(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDirectoryConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDirectoryConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEntitlementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEntitlement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateImageBuilderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateImageBuilder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateImageBuilderStreamingURLSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateImageBuilderStreamingURL(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStreamingURLSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStreamingURL(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateThemeForStackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateThemeForStack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUpdatedImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUpdatedImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUsageReportSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUsageReportSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAppBlockSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAppBlock(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAppBlockBuilderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAppBlockBuilder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDirectoryConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDirectoryConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEntitlementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEntitlement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteImageBuilderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteImageBuilder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteImagePermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteImagePermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteStackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteStack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteThemeForStackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteThemeForStack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUsageReportSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUsageReportSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAppBlockBuilderAppBlockAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAppBlockBuilderAppBlockAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAppBlockBuildersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAppBlockBuilders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAppBlocksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAppBlocks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeApplicationFleetAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeApplicationFleetAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDirectoryConfigsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDirectoryConfigs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEntitlementsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEntitlements(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFleetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFleets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeImageBuildersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeImageBuilders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeImagePermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeImagePermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeImagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeImages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSessionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSessions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStacksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStacks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeThemeForStackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeThemeForStack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeUsageReportSubscriptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeUsageReportSubscriptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeUsersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeUsers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeUserStackAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeUserStackAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateAppBlockBuilderAppBlockSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateAppBlockBuilderAppBlock(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateApplicationFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateApplicationFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateApplicationFromEntitlementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateApplicationFromEntitlement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExpireSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExpireSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssociatedFleetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssociatedFleets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssociatedStacksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssociatedStacks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEntitledApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEntitledApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartAppBlockBuilderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartAppBlockBuilder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartImageBuilderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartImageBuilder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopAppBlockBuilderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopAppBlockBuilder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopImageBuilderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopImageBuilder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAppBlockBuilderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAppBlockBuilder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDirectoryConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDirectoryConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEntitlementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEntitlement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateImagePermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateImagePermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateStackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateStack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateThemeForStackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateThemeForStack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/appsync/generated.json b/service/appsync/generated.json index dc320d6c2d3..4d4d5349e7e 100644 --- a/service/appsync/generated.json +++ b/service/appsync/generated.json @@ -95,6 +95,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/appsync/sra_operation_order_test.go b/service/appsync/sra_operation_order_test.go new file mode 100644 index 00000000000..fc9dcc15acc --- /dev/null +++ b/service/appsync/sra_operation_order_test.go @@ -0,0 +1,2611 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appsync + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateApiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateApi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateMergedGraphqlApiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateMergedGraphqlApi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateSourceGraphqlApiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateSourceGraphqlApi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateApiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateApiCacheSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApiCache(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateApiKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApiKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateChannelNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateChannelNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDomainNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDomainName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFunctionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFunction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGraphqlApiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGraphqlApi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateResolverSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateResolver(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApiCacheSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApiCache(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApiKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApiKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteChannelNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteChannelNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDomainNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDomainName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFunctionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFunction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGraphqlApiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGraphqlApi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResolverSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResolver(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateApiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateApi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateMergedGraphqlApiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateMergedGraphqlApi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateSourceGraphqlApiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateSourceGraphqlApi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEvaluateCodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EvaluateCode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEvaluateMappingTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EvaluateMappingTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpFlushApiCacheSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.FlushApiCache(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApiAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApiAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApiCacheSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApiCache(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetChannelNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetChannelNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataSourceIntrospectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataSourceIntrospection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDomainNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDomainName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFunctionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFunction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGraphqlApiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGraphqlApi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGraphqlApiEnvironmentVariablesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGraphqlApiEnvironmentVariables(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIntrospectionSchemaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIntrospectionSchema(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResolverSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResolver(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSchemaCreationStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSchemaCreationStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSourceApiAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSourceApiAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApiKeysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApiKeys(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListChannelNamespacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListChannelNamespaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataSourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataSources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDomainNamesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDomainNames(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFunctionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFunctions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGraphqlApisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGraphqlApis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResolversSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResolvers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResolversByFunctionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResolversByFunction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSourceApiAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSourceApiAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTypesByAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTypesByAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutGraphqlApiEnvironmentVariablesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutGraphqlApiEnvironmentVariables(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDataSourceIntrospectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDataSourceIntrospection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartSchemaCreationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartSchemaCreation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartSchemaMergeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartSchemaMerge(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApiCacheSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApiCache(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApiKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApiKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateChannelNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateChannelNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDomainNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDomainName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFunctionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFunction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGraphqlApiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGraphqlApi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateResolverSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateResolver(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSourceApiAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSourceApiAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/apptest/generated.json b/service/apptest/generated.json index 36ced98637c..f92b80cc60d 100644 --- a/service/apptest/generated.json +++ b/service/apptest/generated.json @@ -45,6 +45,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/apptest/sra_operation_order_test.go b/service/apptest/sra_operation_order_test.go new file mode 100644 index 00000000000..67d4a282f73 --- /dev/null +++ b/service/apptest/sra_operation_order_test.go @@ -0,0 +1,861 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package apptest + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateTestCaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTestCase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTestConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTestConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTestSuiteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTestSuite(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTestCaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTestCase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTestConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTestConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTestRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTestRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTestSuiteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTestSuite(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTestCaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTestCase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTestConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTestConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTestRunStepSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTestRunStep(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTestSuiteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTestSuite(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTestCasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTestCases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTestConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTestConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTestRunsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTestRuns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTestRunStepsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTestRunSteps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTestRunTestCasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTestRunTestCases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTestSuitesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTestSuites(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartTestRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartTestRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTestCaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTestCase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTestConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTestConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTestSuiteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTestSuite(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/arczonalshift/generated.json b/service/arczonalshift/generated.json index f7ed8897d7d..ac6b3b8afe5 100644 --- a/service/arczonalshift/generated.json +++ b/service/arczonalshift/generated.json @@ -34,6 +34,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/arczonalshift/sra_operation_order_test.go b/service/arczonalshift/sra_operation_order_test.go new file mode 100644 index 00000000000..2259a6117fd --- /dev/null +++ b/service/arczonalshift/sra_operation_order_test.go @@ -0,0 +1,476 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package arczonalshift + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCancelZonalShiftSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelZonalShift(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePracticeRunConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePracticeRunConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePracticeRunConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePracticeRunConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAutoshiftObserverNotificationStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAutoshiftObserverNotificationStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetManagedResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetManagedResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAutoshiftsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAutoshifts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListManagedResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListManagedResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListZonalShiftsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListZonalShifts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartZonalShiftSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartZonalShift(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAutoshiftObserverNotificationStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAutoshiftObserverNotificationStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePracticeRunConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePracticeRunConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateZonalAutoshiftConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateZonalAutoshiftConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateZonalShiftSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateZonalShift(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/artifact/generated.json b/service/artifact/generated.json index 1f691f386d4..cc945641c48 100644 --- a/service/artifact/generated.json +++ b/service/artifact/generated.json @@ -28,6 +28,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/artifact/sra_operation_order_test.go b/service/artifact/sra_operation_order_test.go new file mode 100644 index 00000000000..5d4e7020eb4 --- /dev/null +++ b/service/artifact/sra_operation_order_test.go @@ -0,0 +1,266 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package artifact + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpGetAccountSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccountSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReportMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReportMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTermForReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTermForReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCustomerAgreementsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCustomerAgreements(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAccountSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAccountSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/athena/generated.json b/service/athena/generated.json index 045724fd00e..37e93aa1757 100644 --- a/service/athena/generated.json +++ b/service/athena/generated.json @@ -89,6 +89,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/athena/sra_operation_order_test.go b/service/athena/sra_operation_order_test.go new file mode 100644 index 00000000000..1c9e42a9030 --- /dev/null +++ b/service/athena/sra_operation_order_test.go @@ -0,0 +1,2401 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package athena + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchGetNamedQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetNamedQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetPreparedStatementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetPreparedStatement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetQueryExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetQueryExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelCapacityReservationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelCapacityReservation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCapacityReservationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCapacityReservation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataCatalogSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataCatalog(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateNamedQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNamedQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateNotebookSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNotebook(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePreparedStatementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePreparedStatement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePresignedNotebookUrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePresignedNotebookUrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorkGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorkGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCapacityReservationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCapacityReservation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataCatalogSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataCatalog(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNamedQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNamedQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNotebookSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNotebook(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePreparedStatementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePreparedStatement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWorkGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWorkGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportNotebookSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportNotebook(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCalculationExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCalculationExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCalculationExecutionCodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCalculationExecutionCode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCalculationExecutionStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCalculationExecutionStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCapacityAssignmentConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCapacityAssignmentConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCapacityReservationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCapacityReservation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDatabaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDatabase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataCatalogSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataCatalog(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetNamedQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetNamedQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetNotebookMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetNotebookMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPreparedStatementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPreparedStatement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQueryExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQueryExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQueryResultsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQueryResults(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQueryRuntimeStatisticsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQueryRuntimeStatistics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSessionStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSessionStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTableMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTableMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWorkGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWorkGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportNotebookSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportNotebook(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationDPUSizesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplicationDPUSizes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCalculationExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCalculationExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCapacityReservationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCapacityReservations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDatabasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDatabases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataCatalogsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataCatalogs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEngineVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEngineVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListExecutorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListExecutors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNamedQueriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNamedQueries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNotebookMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNotebookMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNotebookSessionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNotebookSessions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPreparedStatementsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPreparedStatements(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListQueryExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListQueryExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSessionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSessions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTableMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTableMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutCapacityAssignmentConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutCapacityAssignmentConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartCalculationExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartCalculationExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartQueryExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartQueryExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopCalculationExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopCalculationExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopQueryExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopQueryExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTerminateSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TerminateSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCapacityReservationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCapacityReservation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDataCatalogSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataCatalog(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateNamedQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateNamedQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateNotebookSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateNotebook(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateNotebookMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateNotebookMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePreparedStatementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePreparedStatement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWorkGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWorkGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/auditmanager/generated.json b/service/auditmanager/generated.json index 69467cb5331..56c7f9e0571 100644 --- a/service/auditmanager/generated.json +++ b/service/auditmanager/generated.json @@ -83,6 +83,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/auditmanager/sra_operation_order_test.go b/service/auditmanager/sra_operation_order_test.go new file mode 100644 index 00000000000..3bcf8f31fb3 --- /dev/null +++ b/service/auditmanager/sra_operation_order_test.go @@ -0,0 +1,2191 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package auditmanager + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateAssessmentReportEvidenceFolderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateAssessmentReportEvidenceFolder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchAssociateAssessmentReportEvidenceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchAssociateAssessmentReportEvidence(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchCreateDelegationByAssessmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchCreateDelegationByAssessment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeleteDelegationByAssessmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteDelegationByAssessment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDisassociateAssessmentReportEvidenceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDisassociateAssessmentReportEvidence(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchImportEvidenceToAssessmentControlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchImportEvidenceToAssessmentControl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAssessmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAssessment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAssessmentFrameworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAssessmentFramework(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAssessmentReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAssessmentReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateControlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateControl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAssessmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAssessment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAssessmentFrameworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAssessmentFramework(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAssessmentFrameworkShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAssessmentFrameworkShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAssessmentReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAssessmentReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteControlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteControl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterOrganizationAdminAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterOrganizationAdminAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateAssessmentReportEvidenceFolderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateAssessmentReportEvidenceFolder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccountStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccountStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAssessmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAssessment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAssessmentFrameworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAssessmentFramework(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAssessmentReportUrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAssessmentReportUrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetChangeLogsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetChangeLogs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetControlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetControl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDelegationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDelegations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEvidenceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEvidence(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEvidenceByEvidenceFolderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEvidenceByEvidenceFolder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEvidenceFileUploadUrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEvidenceFileUploadUrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEvidenceFolderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEvidenceFolder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEvidenceFoldersByAssessmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEvidenceFoldersByAssessment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEvidenceFoldersByAssessmentControlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEvidenceFoldersByAssessmentControl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInsightsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInsights(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInsightsByAssessmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInsightsByAssessment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOrganizationAdminAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOrganizationAdminAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServicesInScopeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServicesInScope(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssessmentControlInsightsByControlDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssessmentControlInsightsByControlDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssessmentFrameworksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssessmentFrameworks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssessmentFrameworkShareRequestsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssessmentFrameworkShareRequests(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssessmentReportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssessmentReports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssessmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssessments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListControlDomainInsightsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListControlDomainInsights(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListControlDomainInsightsByAssessmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListControlDomainInsightsByAssessment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListControlInsightsByControlDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListControlInsightsByControlDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListControlsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListControls(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListKeywordsForDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListKeywordsForDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNotificationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNotifications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterOrganizationAdminAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterOrganizationAdminAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartAssessmentFrameworkShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartAssessmentFrameworkShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAssessmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAssessment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAssessmentControlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAssessmentControl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAssessmentControlSetStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAssessmentControlSetStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAssessmentFrameworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAssessmentFramework(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAssessmentFrameworkShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAssessmentFrameworkShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAssessmentStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAssessmentStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateControlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateControl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpValidateAssessmentReportIntegritySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ValidateAssessmentReportIntegrity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/autoscaling/generated.json b/service/autoscaling/generated.json index 674d01fddaa..4cd037d2218 100644 --- a/service/autoscaling/generated.json +++ b/service/autoscaling/generated.json @@ -86,6 +86,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/autoscaling/sra_operation_order_test.go b/service/autoscaling/sra_operation_order_test.go new file mode 100644 index 00000000000..ecfa072d8c2 --- /dev/null +++ b/service/autoscaling/sra_operation_order_test.go @@ -0,0 +1,2296 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package autoscaling + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAttachInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachLoadBalancersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachLoadBalancers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachLoadBalancerTargetGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachLoadBalancerTargetGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachTrafficSourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachTrafficSources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeleteScheduledActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteScheduledAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchPutScheduledUpdateGroupActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchPutScheduledUpdateGroupAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelInstanceRefreshSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelInstanceRefresh(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCompleteLifecycleActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CompleteLifecycleAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAutoScalingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAutoScalingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLaunchConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLaunchConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateOrUpdateTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateOrUpdateTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAutoScalingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAutoScalingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLaunchConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLaunchConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLifecycleHookSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLifecycleHook(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNotificationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNotificationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteScheduledActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteScheduledAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWarmPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWarmPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccountLimitsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccountLimits(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAdjustmentTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAdjustmentTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAutoScalingGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAutoScalingGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAutoScalingInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAutoScalingInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAutoScalingNotificationTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAutoScalingNotificationTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInstanceRefreshesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInstanceRefreshes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLaunchConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLaunchConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLifecycleHooksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLifecycleHooks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLifecycleHookTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLifecycleHookTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLoadBalancersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLoadBalancers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLoadBalancerTargetGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLoadBalancerTargetGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMetricCollectionTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMetricCollectionTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeNotificationConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeNotificationConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeScalingActivitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeScalingActivities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeScalingProcessTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeScalingProcessTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeScheduledActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeScheduledActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTerminationPolicyTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTerminationPolicyTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTrafficSourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTrafficSources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWarmPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWarmPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachLoadBalancersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachLoadBalancers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachLoadBalancerTargetGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachLoadBalancerTargetGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachTrafficSourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachTrafficSources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableMetricsCollectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableMetricsCollection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableMetricsCollectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableMetricsCollection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnterStandbySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnterStandby(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExecutePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExecutePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExitStandbySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExitStandby(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPredictiveScalingForecastSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPredictiveScalingForecast(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutLifecycleHookSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutLifecycleHook(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutNotificationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutNotificationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutScalingPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutScalingPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutScheduledUpdateGroupActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutScheduledUpdateGroupAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutWarmPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutWarmPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRecordLifecycleActionHeartbeatSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RecordLifecycleActionHeartbeat(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResumeProcessesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResumeProcesses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRollbackInstanceRefreshSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RollbackInstanceRefresh(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetDesiredCapacitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetDesiredCapacity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetInstanceHealthSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetInstanceHealth(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetInstanceProtectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetInstanceProtection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartInstanceRefreshSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartInstanceRefresh(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSuspendProcessesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SuspendProcesses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTerminateInstanceInAutoScalingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TerminateInstanceInAutoScalingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAutoScalingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAutoScalingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/autoscalingplans/generated.json b/service/autoscalingplans/generated.json index ba052cfef0e..59f716fddf1 100644 --- a/service/autoscalingplans/generated.json +++ b/service/autoscalingplans/generated.json @@ -27,6 +27,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/autoscalingplans/sra_operation_order_test.go b/service/autoscalingplans/sra_operation_order_test.go new file mode 100644 index 00000000000..9d89fa81422 --- /dev/null +++ b/service/autoscalingplans/sra_operation_order_test.go @@ -0,0 +1,231 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package autoscalingplans + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateScalingPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateScalingPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteScalingPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteScalingPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeScalingPlanResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeScalingPlanResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeScalingPlansSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeScalingPlans(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetScalingPlanResourceForecastDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetScalingPlanResourceForecastData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateScalingPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateScalingPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/b2bi/generated.json b/service/b2bi/generated.json index 39dd63d8d79..755a415a1e1 100644 --- a/service/b2bi/generated.json +++ b/service/b2bi/generated.json @@ -51,6 +51,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/b2bi/sra_operation_order_test.go b/service/b2bi/sra_operation_order_test.go new file mode 100644 index 00000000000..508ff4e15ae --- /dev/null +++ b/service/b2bi/sra_operation_order_test.go @@ -0,0 +1,1071 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package b2bi + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateCapabilitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCapability(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePartnershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePartnership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStarterMappingTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStarterMappingTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTransformerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTransformer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCapabilitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCapability(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePartnershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePartnership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTransformerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTransformer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGenerateMappingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GenerateMapping(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCapabilitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCapability(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPartnershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPartnership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTransformerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTransformer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTransformerJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTransformerJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCapabilitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCapabilities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPartnershipsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPartnerships(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTransformersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTransformers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartTransformerJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartTransformerJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestConversionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestConversion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestMappingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestMapping(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestParsingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestParsing(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCapabilitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCapability(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePartnershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePartnership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTransformerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTransformer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/backup/generated.json b/service/backup/generated.json index b8178e412a8..66d65d49b55 100644 --- a/service/backup/generated.json +++ b/service/backup/generated.json @@ -115,6 +115,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/backup/sra_operation_order_test.go b/service/backup/sra_operation_order_test.go new file mode 100644 index 00000000000..ba7603e9e9a --- /dev/null +++ b/service/backup/sra_operation_order_test.go @@ -0,0 +1,3311 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package backup + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCancelLegalHoldSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelLegalHold(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBackupPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBackupPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBackupSelectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBackupSelection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBackupVaultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBackupVault(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFrameworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFramework(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLegalHoldSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLegalHold(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLogicallyAirGappedBackupVaultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLogicallyAirGappedBackupVault(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateReportPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateReportPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRestoreTestingPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRestoreTestingPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRestoreTestingSelectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRestoreTestingSelection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBackupPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBackupPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBackupSelectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBackupSelection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBackupVaultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBackupVault(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBackupVaultAccessPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBackupVaultAccessPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBackupVaultLockConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBackupVaultLockConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBackupVaultNotificationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBackupVaultNotifications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFrameworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFramework(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRecoveryPointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRecoveryPoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteReportPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteReportPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRestoreTestingPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRestoreTestingPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRestoreTestingSelectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRestoreTestingSelection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBackupJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBackupJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBackupVaultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBackupVault(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCopyJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCopyJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFrameworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFramework(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGlobalSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGlobalSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeProtectedResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeProtectedResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRecoveryPointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRecoveryPoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRegionSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRegionSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReportPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReportPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRestoreJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRestoreJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateRecoveryPointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateRecoveryPoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateRecoveryPointFromParentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateRecoveryPointFromParent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportBackupPlanTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportBackupPlanTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBackupPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBackupPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBackupPlanFromJSONSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBackupPlanFromJSON(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBackupPlanFromTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBackupPlanFromTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBackupSelectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBackupSelection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBackupVaultAccessPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBackupVaultAccessPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBackupVaultNotificationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBackupVaultNotifications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLegalHoldSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLegalHold(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRecoveryPointIndexDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRecoveryPointIndexDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRecoveryPointRestoreMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRecoveryPointRestoreMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRestoreJobMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRestoreJobMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRestoreTestingInferredMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRestoreTestingInferredMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRestoreTestingPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRestoreTestingPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRestoreTestingSelectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRestoreTestingSelection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSupportedResourceTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSupportedResourceTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBackupJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBackupJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBackupJobSummariesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBackupJobSummaries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBackupPlansSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBackupPlans(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBackupPlanTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBackupPlanTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBackupPlanVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBackupPlanVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBackupSelectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBackupSelections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBackupVaultsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBackupVaults(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCopyJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCopyJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCopyJobSummariesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCopyJobSummaries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFrameworksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFrameworks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIndexedRecoveryPointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIndexedRecoveryPoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLegalHoldsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLegalHolds(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProtectedResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProtectedResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProtectedResourcesByBackupVaultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProtectedResourcesByBackupVault(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRecoveryPointsByBackupVaultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRecoveryPointsByBackupVault(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRecoveryPointsByLegalHoldSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRecoveryPointsByLegalHold(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRecoveryPointsByResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRecoveryPointsByResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReportPlansSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReportPlans(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRestoreJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRestoreJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRestoreJobsByProtectedResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRestoreJobsByProtectedResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRestoreJobSummariesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRestoreJobSummaries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRestoreTestingPlansSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRestoreTestingPlans(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRestoreTestingSelectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRestoreTestingSelections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBackupVaultAccessPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBackupVaultAccessPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBackupVaultLockConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBackupVaultLockConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBackupVaultNotificationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBackupVaultNotifications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRestoreValidationResultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRestoreValidationResult(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartBackupJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartBackupJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartCopyJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartCopyJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartReportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartReportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartRestoreJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartRestoreJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopBackupJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopBackupJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBackupPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBackupPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFrameworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFramework(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGlobalSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGlobalSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRecoveryPointIndexSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRecoveryPointIndexSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRecoveryPointLifecycleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRecoveryPointLifecycle(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRegionSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRegionSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateReportPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateReportPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRestoreTestingPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRestoreTestingPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRestoreTestingSelectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRestoreTestingSelection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/backupgateway/generated.json b/service/backupgateway/generated.json index fa19c9f3a1d..b2df57aa5de 100644 --- a/service/backupgateway/generated.json +++ b/service/backupgateway/generated.json @@ -46,6 +46,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/backupgateway/sra_operation_order_test.go b/service/backupgateway/sra_operation_order_test.go new file mode 100644 index 00000000000..6506f7c90cd --- /dev/null +++ b/service/backupgateway/sra_operation_order_test.go @@ -0,0 +1,896 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package backupgateway + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateGatewayToServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateGatewayToServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteHypervisorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteHypervisor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateGatewayFromServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateGatewayFromServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBandwidthRateLimitScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBandwidthRateLimitSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetHypervisorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetHypervisor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetHypervisorPropertyMappingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetHypervisorPropertyMappings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVirtualMachineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVirtualMachine(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportHypervisorConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportHypervisorConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGatewaysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGateways(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListHypervisorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListHypervisors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVirtualMachinesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVirtualMachines(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBandwidthRateLimitScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBandwidthRateLimitSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutHypervisorPropertyMappingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutHypervisorPropertyMappings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutMaintenanceStartTimeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutMaintenanceStartTime(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartVirtualMachinesMetadataSyncSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartVirtualMachinesMetadataSync(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestHypervisorConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestHypervisorConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGatewayInformationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGatewayInformation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGatewaySoftwareNowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGatewaySoftwareNow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateHypervisorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateHypervisor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/backupsearch/generated.json b/service/backupsearch/generated.json index 826e0443cb6..de5ed4cf53a 100644 --- a/service/backupsearch/generated.json +++ b/service/backupsearch/generated.json @@ -33,6 +33,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/backupsearch/sra_operation_order_test.go b/service/backupsearch/sra_operation_order_test.go new file mode 100644 index 00000000000..861184bf130 --- /dev/null +++ b/service/backupsearch/sra_operation_order_test.go @@ -0,0 +1,441 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package backupsearch + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpGetSearchJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSearchJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSearchResultExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSearchResultExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSearchJobBackupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSearchJobBackups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSearchJobResultsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSearchJobResults(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSearchJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSearchJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSearchResultExportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSearchResultExportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartSearchJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartSearchJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartSearchResultExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartSearchResultExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopSearchJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopSearchJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/batch/generated.json b/service/batch/generated.json index c28c218d5bf..ee9d796500e 100644 --- a/service/batch/generated.json +++ b/service/batch/generated.json @@ -52,6 +52,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/batch/sra_operation_order_test.go b/service/batch/sra_operation_order_test.go new file mode 100644 index 00000000000..859c22820f8 --- /dev/null +++ b/service/batch/sra_operation_order_test.go @@ -0,0 +1,1106 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package batch + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCancelJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateComputeEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateComputeEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConsumableResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConsumableResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateJobQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateJobQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSchedulingPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSchedulingPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteComputeEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteComputeEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConsumableResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConsumableResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteJobQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteJobQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSchedulingPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSchedulingPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterJobDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterJobDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeComputeEnvironmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeComputeEnvironments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConsumableResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConsumableResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeJobDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeJobDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeJobQueuesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeJobQueues(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSchedulingPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSchedulingPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetJobQueueSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetJobQueueSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConsumableResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConsumableResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJobsByConsumableResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJobsByConsumableResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSchedulingPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSchedulingPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterJobDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterJobDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSubmitJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SubmitJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTerminateJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TerminateJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateComputeEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateComputeEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConsumableResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConsumableResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateJobQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateJobQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSchedulingPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSchedulingPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/bcmdataexports/generated.json b/service/bcmdataexports/generated.json index 62791c57ef5..eca1e019813 100644 --- a/service/bcmdataexports/generated.json +++ b/service/bcmdataexports/generated.json @@ -33,6 +33,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/bcmdataexports/sra_operation_order_test.go b/service/bcmdataexports/sra_operation_order_test.go new file mode 100644 index 00000000000..c1de8d2bfc8 --- /dev/null +++ b/service/bcmdataexports/sra_operation_order_test.go @@ -0,0 +1,441 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bcmdataexports + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListExportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListExports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTablesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTables(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/bcmpricingcalculator/generated.json b/service/bcmpricingcalculator/generated.json index 863b90ebde8..6d4177c13a7 100644 --- a/service/bcmpricingcalculator/generated.json +++ b/service/bcmpricingcalculator/generated.json @@ -57,6 +57,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/bcmpricingcalculator/sra_operation_order_test.go b/service/bcmpricingcalculator/sra_operation_order_test.go new file mode 100644 index 00000000000..7970f08f57a --- /dev/null +++ b/service/bcmpricingcalculator/sra_operation_order_test.go @@ -0,0 +1,1281 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bcmpricingcalculator + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchCreateBillScenarioCommitmentModificationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchCreateBillScenarioCommitmentModification(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchCreateBillScenarioUsageModificationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchCreateBillScenarioUsageModification(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchCreateWorkloadEstimateUsageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchCreateWorkloadEstimateUsage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeleteBillScenarioCommitmentModificationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteBillScenarioCommitmentModification(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeleteBillScenarioUsageModificationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteBillScenarioUsageModification(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeleteWorkloadEstimateUsageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteWorkloadEstimateUsage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchUpdateBillScenarioCommitmentModificationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchUpdateBillScenarioCommitmentModification(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchUpdateBillScenarioUsageModificationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchUpdateBillScenarioUsageModification(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchUpdateWorkloadEstimateUsageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchUpdateWorkloadEstimateUsage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBillEstimateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBillEstimate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBillScenarioSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBillScenario(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorkloadEstimateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorkloadEstimate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBillEstimateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBillEstimate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBillScenarioSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBillScenario(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWorkloadEstimateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWorkloadEstimate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBillEstimateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBillEstimate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBillScenarioSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBillScenario(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPreferencesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPreferences(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWorkloadEstimateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWorkloadEstimate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBillEstimateCommitmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBillEstimateCommitments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBillEstimateInputCommitmentModificationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBillEstimateInputCommitmentModifications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBillEstimateInputUsageModificationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBillEstimateInputUsageModifications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBillEstimateLineItemsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBillEstimateLineItems(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBillEstimatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBillEstimates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBillScenarioCommitmentModificationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBillScenarioCommitmentModifications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBillScenariosSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBillScenarios(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBillScenarioUsageModificationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBillScenarioUsageModifications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkloadEstimatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkloadEstimates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkloadEstimateUsageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkloadEstimateUsage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBillEstimateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBillEstimate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBillScenarioSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBillScenario(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePreferencesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePreferences(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWorkloadEstimateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWorkloadEstimate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/bedrock/generated.json b/service/bedrock/generated.json index 760864bdbbe..6e8e78868c9 100644 --- a/service/bedrock/generated.json +++ b/service/bedrock/generated.json @@ -82,6 +82,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/bedrock/sra_operation_order_test.go b/service/bedrock/sra_operation_order_test.go new file mode 100644 index 00000000000..84df55fe560 --- /dev/null +++ b/service/bedrock/sra_operation_order_test.go @@ -0,0 +1,2016 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrock + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchDeleteEvaluationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteEvaluationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEvaluationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEvaluationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGuardrailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGuardrail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGuardrailVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGuardrailVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInferenceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInferenceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMarketplaceModelEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMarketplaceModelEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateModelCopyJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateModelCopyJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateModelCustomizationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateModelCustomizationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateModelImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateModelImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateModelInvocationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateModelInvocationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProvisionedModelThroughputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProvisionedModelThroughput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCustomModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCustomModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGuardrailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGuardrail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteImportedModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteImportedModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInferenceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInferenceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMarketplaceModelEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMarketplaceModelEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteModelInvocationLoggingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteModelInvocationLoggingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProvisionedModelThroughputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProvisionedModelThroughput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterMarketplaceModelEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterMarketplaceModelEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCustomModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCustomModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEvaluationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEvaluationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFoundationModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFoundationModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGuardrailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGuardrail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetImportedModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetImportedModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInferenceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInferenceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMarketplaceModelEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMarketplaceModelEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetModelCopyJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetModelCopyJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetModelCustomizationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetModelCustomizationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetModelImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetModelImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetModelInvocationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetModelInvocationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetModelInvocationLoggingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetModelInvocationLoggingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPromptRouterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPromptRouter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetProvisionedModelThroughputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetProvisionedModelThroughput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCustomModelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCustomModels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEvaluationJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEvaluationJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFoundationModelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFoundationModels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGuardrailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGuardrails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListImportedModelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListImportedModels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInferenceProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInferenceProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMarketplaceModelEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMarketplaceModelEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListModelCopyJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListModelCopyJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListModelCustomizationJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListModelCustomizationJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListModelImportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListModelImportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListModelInvocationJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListModelInvocationJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPromptRoutersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPromptRouters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProvisionedModelThroughputsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProvisionedModelThroughputs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutModelInvocationLoggingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutModelInvocationLoggingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterMarketplaceModelEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterMarketplaceModelEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopEvaluationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopEvaluationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopModelCustomizationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopModelCustomizationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopModelInvocationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopModelInvocationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGuardrailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGuardrail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMarketplaceModelEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMarketplaceModelEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProvisionedModelThroughputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProvisionedModelThroughput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/bedrockagent/generated.json b/service/bedrockagent/generated.json index a22c54723fe..7351031caf6 100644 --- a/service/bedrockagent/generated.json +++ b/service/bedrockagent/generated.json @@ -97,6 +97,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/bedrockagent/sra_operation_order_test.go b/service/bedrockagent/sra_operation_order_test.go new file mode 100644 index 00000000000..226e398326f --- /dev/null +++ b/service/bedrockagent/sra_operation_order_test.go @@ -0,0 +1,2541 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockagent + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateAgentCollaboratorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateAgentCollaborator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateAgentKnowledgeBaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateAgentKnowledgeBase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAgentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAgent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAgentActionGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAgentActionGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAgentAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAgentAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFlowAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFlowAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFlowVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFlowVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateKnowledgeBaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateKnowledgeBase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePromptSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePrompt(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePromptVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePromptVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAgentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAgent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAgentActionGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAgentActionGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAgentAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAgentAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAgentVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAgentVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFlowAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFlowAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFlowVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFlowVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteKnowledgeBaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteKnowledgeBase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteKnowledgeBaseDocumentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteKnowledgeBaseDocuments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePromptSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePrompt(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateAgentCollaboratorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateAgentCollaborator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateAgentKnowledgeBaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateAgentKnowledgeBase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAgentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAgent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAgentActionGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAgentActionGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAgentAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAgentAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAgentCollaboratorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAgentCollaborator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAgentKnowledgeBaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAgentKnowledgeBase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAgentVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAgentVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFlowAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFlowAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFlowVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFlowVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIngestionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIngestionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetKnowledgeBaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetKnowledgeBase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetKnowledgeBaseDocumentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetKnowledgeBaseDocuments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPromptSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPrompt(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpIngestKnowledgeBaseDocumentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.IngestKnowledgeBaseDocuments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAgentActionGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAgentActionGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAgentAliasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAgentAliases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAgentCollaboratorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAgentCollaborators(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAgentKnowledgeBasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAgentKnowledgeBases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAgentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAgents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAgentVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAgentVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataSourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataSources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFlowAliasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFlowAliases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFlowsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFlows(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFlowVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFlowVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIngestionJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIngestionJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListKnowledgeBaseDocumentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListKnowledgeBaseDocuments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListKnowledgeBasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListKnowledgeBases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPromptsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPrompts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPrepareAgentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PrepareAgent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPrepareFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PrepareFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartIngestionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartIngestionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopIngestionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopIngestionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAgentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAgent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAgentActionGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAgentActionGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAgentAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAgentAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAgentCollaboratorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAgentCollaborator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAgentKnowledgeBaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAgentKnowledgeBase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFlowAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFlowAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateKnowledgeBaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateKnowledgeBase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePromptSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePrompt(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpValidateFlowDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ValidateFlowDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/bedrockagentruntime/generated.json b/service/bedrockagentruntime/generated.json index 48753051c46..46f9a72b9d4 100644 --- a/service/bedrockagentruntime/generated.json +++ b/service/bedrockagentruntime/generated.json @@ -52,6 +52,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/bedrockagentruntime/sra_operation_order_test.go b/service/bedrockagentruntime/sra_operation_order_test.go new file mode 100644 index 00000000000..5bccfdd80b4 --- /dev/null +++ b/service/bedrockagentruntime/sra_operation_order_test.go @@ -0,0 +1,896 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockagentruntime + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateInvocationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInvocation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAgentMemorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAgentMemory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEndSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EndSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGenerateQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GenerateQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAgentMemorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAgentMemory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInvocationStepSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInvocationStep(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInvokeAgentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InvokeAgent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInvokeFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InvokeFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInvokeInlineAgentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InvokeInlineAgent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInvocationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInvocations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInvocationStepsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInvocationSteps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSessionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSessions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpOptimizePromptSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.OptimizePrompt(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutInvocationStepSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutInvocationStep(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRerankSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Rerank(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRetrieveSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Retrieve(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRetrieveAndGenerateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RetrieveAndGenerate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRetrieveAndGenerateStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RetrieveAndGenerateStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/bedrockdataautomation/generated.json b/service/bedrockdataautomation/generated.json index a4893672d21..b16a93b21a7 100644 --- a/service/bedrockdataautomation/generated.json +++ b/service/bedrockdataautomation/generated.json @@ -35,6 +35,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/bedrockdataautomation/sra_operation_order_test.go b/service/bedrockdataautomation/sra_operation_order_test.go new file mode 100644 index 00000000000..6c0e8e3c94d --- /dev/null +++ b/service/bedrockdataautomation/sra_operation_order_test.go @@ -0,0 +1,511 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockdataautomation + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateBlueprintSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBlueprint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBlueprintVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBlueprintVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataAutomationProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataAutomationProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBlueprintSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBlueprint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataAutomationProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataAutomationProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBlueprintSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBlueprint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataAutomationProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataAutomationProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBlueprintsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBlueprints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataAutomationProjectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataAutomationProjects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBlueprintSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBlueprint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDataAutomationProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataAutomationProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/bedrockdataautomationruntime/generated.json b/service/bedrockdataautomationruntime/generated.json index 33b92b98d11..b69f13de745 100644 --- a/service/bedrockdataautomationruntime/generated.json +++ b/service/bedrockdataautomationruntime/generated.json @@ -26,6 +26,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/bedrockdataautomationruntime/sra_operation_order_test.go b/service/bedrockdataautomationruntime/sra_operation_order_test.go new file mode 100644 index 00000000000..30a9b476c86 --- /dev/null +++ b/service/bedrockdataautomationruntime/sra_operation_order_test.go @@ -0,0 +1,196 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockdataautomationruntime + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpGetDataAutomationStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataAutomationStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInvokeDataAutomationAsyncSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InvokeDataAutomationAsync(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/bedrockruntime/generated.json b/service/bedrockruntime/generated.json index eb0a4751d36..fa23423a1d8 100644 --- a/service/bedrockruntime/generated.json +++ b/service/bedrockruntime/generated.json @@ -35,6 +35,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/bedrockruntime/sra_operation_order_test.go b/service/bedrockruntime/sra_operation_order_test.go new file mode 100644 index 00000000000..47dd0e02015 --- /dev/null +++ b/service/bedrockruntime/sra_operation_order_test.go @@ -0,0 +1,301 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package bedrockruntime + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpApplyGuardrailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ApplyGuardrail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpConverseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Converse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpConverseStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ConverseStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAsyncInvokeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAsyncInvoke(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInvokeModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InvokeModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInvokeModelWithResponseStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InvokeModelWithResponseStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAsyncInvokesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAsyncInvokes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartAsyncInvokeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartAsyncInvoke(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/billing/generated.json b/service/billing/generated.json index c229973e433..b27c784412b 100644 --- a/service/billing/generated.json +++ b/service/billing/generated.json @@ -31,6 +31,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/billing/sra_operation_order_test.go b/service/billing/sra_operation_order_test.go new file mode 100644 index 00000000000..123216cac12 --- /dev/null +++ b/service/billing/sra_operation_order_test.go @@ -0,0 +1,371 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package billing + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateBillingViewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBillingView(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBillingViewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBillingView(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBillingViewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBillingView(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBillingViewsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBillingViews(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSourceViewsForBillingViewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSourceViewsForBillingView(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBillingViewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBillingView(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/billingconductor/generated.json b/service/billingconductor/generated.json index e7f26136628..cdd15c43f5a 100644 --- a/service/billingconductor/generated.json +++ b/service/billingconductor/generated.json @@ -53,6 +53,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/billingconductor/sra_operation_order_test.go b/service/billingconductor/sra_operation_order_test.go new file mode 100644 index 00000000000..21c2b429dff --- /dev/null +++ b/service/billingconductor/sra_operation_order_test.go @@ -0,0 +1,1141 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package billingconductor + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateAccountsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateAccounts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociatePricingRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociatePricingRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchAssociateResourcesToCustomLineItemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchAssociateResourcesToCustomLineItem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDisassociateResourcesFromCustomLineItemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDisassociateResourcesFromCustomLineItem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBillingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBillingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCustomLineItemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCustomLineItem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePricingPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePricingPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePricingRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePricingRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBillingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBillingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCustomLineItemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCustomLineItem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePricingPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePricingPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePricingRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePricingRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateAccountsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateAccounts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociatePricingRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociatePricingRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBillingGroupCostReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBillingGroupCostReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccountAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccountAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBillingGroupCostReportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBillingGroupCostReports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBillingGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBillingGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCustomLineItemsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCustomLineItems(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCustomLineItemVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCustomLineItemVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPricingPlansSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPricingPlans(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPricingPlansAssociatedWithPricingRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPricingPlansAssociatedWithPricingRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPricingRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPricingRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPricingRulesAssociatedToPricingPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPricingRulesAssociatedToPricingPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourcesAssociatedToCustomLineItemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourcesAssociatedToCustomLineItem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBillingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBillingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCustomLineItemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCustomLineItem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePricingPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePricingPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePricingRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePricingRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/braket/generated.json b/service/braket/generated.json index 9b759375212..1c89488e6e1 100644 --- a/service/braket/generated.json +++ b/service/braket/generated.json @@ -34,6 +34,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/braket/sra_operation_order_test.go b/service/braket/sra_operation_order_test.go new file mode 100644 index 00000000000..4d033bec4da --- /dev/null +++ b/service/braket/sra_operation_order_test.go @@ -0,0 +1,476 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package braket + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCancelJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelQuantumTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelQuantumTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateQuantumTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateQuantumTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQuantumTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQuantumTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchDevicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchDevices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchQuantumTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchQuantumTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/budgets/generated.json b/service/budgets/generated.json index e8207fc6ecb..d08a075a884 100644 --- a/service/budgets/generated.json +++ b/service/budgets/generated.json @@ -47,6 +47,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/budgets/sra_operation_order_test.go b/service/budgets/sra_operation_order_test.go new file mode 100644 index 00000000000..8299f7f987a --- /dev/null +++ b/service/budgets/sra_operation_order_test.go @@ -0,0 +1,931 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package budgets + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateBudgetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBudget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBudgetActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBudgetAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateNotificationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNotification(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSubscriberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSubscriber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBudgetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBudget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBudgetActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBudgetAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNotificationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNotification(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSubscriberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSubscriber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBudgetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBudget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBudgetActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBudgetAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBudgetActionHistoriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBudgetActionHistories(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBudgetActionsForAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBudgetActionsForAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBudgetActionsForBudgetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBudgetActionsForBudget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBudgetNotificationsForAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBudgetNotificationsForAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBudgetPerformanceHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBudgetPerformanceHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBudgetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBudgets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeNotificationsForBudgetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeNotificationsForBudget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSubscribersForNotificationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSubscribersForNotification(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExecuteBudgetActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExecuteBudgetAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBudgetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBudget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBudgetActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBudgetAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateNotificationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateNotification(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSubscriberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSubscriber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/chatbot/generated.json b/service/chatbot/generated.json index 080756ea3ee..e68a71c54ab 100644 --- a/service/chatbot/generated.json +++ b/service/chatbot/generated.json @@ -55,6 +55,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/chatbot/sra_operation_order_test.go b/service/chatbot/sra_operation_order_test.go new file mode 100644 index 00000000000..0ceb282c75f --- /dev/null +++ b/service/chatbot/sra_operation_order_test.go @@ -0,0 +1,1211 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chatbot + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateToConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateToConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateChimeWebhookConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateChimeWebhookConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCustomActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCustomAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMicrosoftTeamsChannelConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMicrosoftTeamsChannelConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSlackChannelConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSlackChannelConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteChimeWebhookConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteChimeWebhookConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCustomActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCustomAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMicrosoftTeamsChannelConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMicrosoftTeamsChannelConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMicrosoftTeamsConfiguredTeamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMicrosoftTeamsConfiguredTeam(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMicrosoftTeamsUserIdentitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMicrosoftTeamsUserIdentity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSlackChannelConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSlackChannelConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSlackUserIdentitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSlackUserIdentity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSlackWorkspaceAuthorizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSlackWorkspaceAuthorization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeChimeWebhookConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeChimeWebhookConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSlackChannelConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSlackChannelConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSlackUserIdentitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSlackUserIdentities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSlackWorkspacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSlackWorkspaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateFromConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateFromConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccountPreferencesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccountPreferences(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCustomActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCustomAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMicrosoftTeamsChannelConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMicrosoftTeamsChannelConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCustomActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCustomActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMicrosoftTeamsChannelConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMicrosoftTeamsChannelConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMicrosoftTeamsConfiguredTeamsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMicrosoftTeamsConfiguredTeams(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMicrosoftTeamsUserIdentitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMicrosoftTeamsUserIdentities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAccountPreferencesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAccountPreferences(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateChimeWebhookConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateChimeWebhookConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCustomActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCustomAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMicrosoftTeamsChannelConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMicrosoftTeamsChannelConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSlackChannelConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSlackChannelConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/chime/generated.json b/service/chime/generated.json index 18a1413ecb1..30d2c787b07 100644 --- a/service/chime/generated.json +++ b/service/chime/generated.json @@ -83,6 +83,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/chime/sra_operation_order_test.go b/service/chime/sra_operation_order_test.go new file mode 100644 index 00000000000..3f5bbc7941d --- /dev/null +++ b/service/chime/sra_operation_order_test.go @@ -0,0 +1,2191 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chime + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociatePhoneNumberWithUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociatePhoneNumberWithUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateSigninDelegateGroupsWithAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateSigninDelegateGroupsWithAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchCreateRoomMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchCreateRoomMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeletePhoneNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeletePhoneNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchSuspendUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchSuspendUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchUnsuspendUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchUnsuspendUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchUpdatePhoneNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchUpdatePhoneNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchUpdateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchUpdateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMeetingDialOutSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMeetingDialOut(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePhoneNumberOrderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePhoneNumberOrder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRoomSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRoom(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRoomMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRoomMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEventsConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEventsConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePhoneNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePhoneNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRoomSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRoom(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRoomMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRoomMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociatePhoneNumberFromUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociatePhoneNumberFromUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateSigninDelegateGroupsFromAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateSigninDelegateGroupsFromAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccountSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccountSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEventsConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEventsConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGlobalSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGlobalSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPhoneNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPhoneNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPhoneNumberOrderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPhoneNumberOrder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPhoneNumberSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPhoneNumberSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRetentionSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRetentionSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRoomSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRoom(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUserSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUserSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInviteUsersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InviteUsers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccountsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccounts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPhoneNumberOrdersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPhoneNumberOrders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPhoneNumbersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPhoneNumbers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRoomMembershipsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRoomMemberships(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRoomsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRooms(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSupportedPhoneNumberCountriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSupportedPhoneNumberCountries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUsersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUsers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpLogoutUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.LogoutUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutEventsConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutEventsConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRetentionSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRetentionSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRedactConversationMessageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RedactConversationMessage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRedactRoomMessageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RedactRoomMessage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegenerateSecurityTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegenerateSecurityToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetPersonalPINSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetPersonalPIN(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestorePhoneNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestorePhoneNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchAvailablePhoneNumbersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchAvailablePhoneNumbers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAccountSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAccountSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGlobalSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGlobalSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePhoneNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePhoneNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePhoneNumberSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePhoneNumberSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRoomSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRoom(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRoomMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRoomMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUserSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/chimesdkidentity/generated.json b/service/chimesdkidentity/generated.json index c4f62f88e4b..65972684b28 100644 --- a/service/chimesdkidentity/generated.json +++ b/service/chimesdkidentity/generated.json @@ -51,6 +51,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/chimesdkidentity/sra_operation_order_test.go b/service/chimesdkidentity/sra_operation_order_test.go new file mode 100644 index 00000000000..fdcea57f3c5 --- /dev/null +++ b/service/chimesdkidentity/sra_operation_order_test.go @@ -0,0 +1,1071 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkidentity + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateAppInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAppInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAppInstanceAdminSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAppInstanceAdmin(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAppInstanceBotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAppInstanceBot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAppInstanceUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAppInstanceUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAppInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAppInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAppInstanceAdminSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAppInstanceAdmin(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAppInstanceBotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAppInstanceBot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAppInstanceUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAppInstanceUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterAppInstanceUserEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterAppInstanceUserEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAppInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAppInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAppInstanceAdminSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAppInstanceAdmin(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAppInstanceBotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAppInstanceBot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAppInstanceUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAppInstanceUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAppInstanceUserEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAppInstanceUserEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAppInstanceRetentionSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAppInstanceRetentionSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAppInstanceAdminsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAppInstanceAdmins(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAppInstanceBotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAppInstanceBots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAppInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAppInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAppInstanceUserEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAppInstanceUserEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAppInstanceUsersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAppInstanceUsers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAppInstanceRetentionSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAppInstanceRetentionSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAppInstanceUserExpirationSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAppInstanceUserExpirationSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterAppInstanceUserEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterAppInstanceUserEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAppInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAppInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAppInstanceBotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAppInstanceBot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAppInstanceUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAppInstanceUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAppInstanceUserEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAppInstanceUserEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/chimesdkmediapipelines/generated.json b/service/chimesdkmediapipelines/generated.json index 62f18e5ee74..a15621ee428 100644 --- a/service/chimesdkmediapipelines/generated.json +++ b/service/chimesdkmediapipelines/generated.json @@ -52,6 +52,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/chimesdkmediapipelines/sra_operation_order_test.go b/service/chimesdkmediapipelines/sra_operation_order_test.go new file mode 100644 index 00000000000..520ff55d934 --- /dev/null +++ b/service/chimesdkmediapipelines/sra_operation_order_test.go @@ -0,0 +1,1106 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkmediapipelines + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateMediaCapturePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMediaCapturePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMediaConcatenationPipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMediaConcatenationPipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMediaInsightsPipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMediaInsightsPipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMediaInsightsPipelineConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMediaInsightsPipelineConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMediaLiveConnectorPipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMediaLiveConnectorPipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMediaPipelineKinesisVideoStreamPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMediaPipelineKinesisVideoStreamPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMediaStreamPipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMediaStreamPipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMediaCapturePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMediaCapturePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMediaInsightsPipelineConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMediaInsightsPipelineConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMediaPipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMediaPipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMediaPipelineKinesisVideoStreamPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMediaPipelineKinesisVideoStreamPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMediaCapturePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMediaCapturePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMediaInsightsPipelineConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMediaInsightsPipelineConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMediaPipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMediaPipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMediaPipelineKinesisVideoStreamPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMediaPipelineKinesisVideoStreamPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSpeakerSearchTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSpeakerSearchTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVoiceToneAnalysisTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVoiceToneAnalysisTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMediaCapturePipelinesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMediaCapturePipelines(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMediaInsightsPipelineConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMediaInsightsPipelineConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMediaPipelineKinesisVideoStreamPoolsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMediaPipelineKinesisVideoStreamPools(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMediaPipelinesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMediaPipelines(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartSpeakerSearchTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartSpeakerSearchTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartVoiceToneAnalysisTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartVoiceToneAnalysisTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopSpeakerSearchTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopSpeakerSearchTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopVoiceToneAnalysisTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopVoiceToneAnalysisTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMediaInsightsPipelineConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMediaInsightsPipelineConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMediaInsightsPipelineStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMediaInsightsPipelineStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMediaPipelineKinesisVideoStreamPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMediaPipelineKinesisVideoStreamPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/chimesdkmeetings/generated.json b/service/chimesdkmeetings/generated.json index 9591a976623..5a95f07baca 100644 --- a/service/chimesdkmeetings/generated.json +++ b/service/chimesdkmeetings/generated.json @@ -37,6 +37,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/chimesdkmeetings/sra_operation_order_test.go b/service/chimesdkmeetings/sra_operation_order_test.go new file mode 100644 index 00000000000..5805bb1bf8d --- /dev/null +++ b/service/chimesdkmeetings/sra_operation_order_test.go @@ -0,0 +1,581 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkmeetings + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchCreateAttendeeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchCreateAttendee(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchUpdateAttendeeCapabilitiesExceptSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchUpdateAttendeeCapabilitiesExcept(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAttendeeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAttendee(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMeetingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMeeting(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMeetingWithAttendeesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMeetingWithAttendees(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAttendeeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAttendee(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMeetingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMeeting(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAttendeeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAttendee(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMeetingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMeeting(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAttendeesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAttendees(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMeetingTranscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMeetingTranscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopMeetingTranscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopMeetingTranscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAttendeeCapabilitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAttendeeCapabilities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/chimesdkmessaging/generated.json b/service/chimesdkmessaging/generated.json index 31e45df85c5..82df7d00e94 100644 --- a/service/chimesdkmessaging/generated.json +++ b/service/chimesdkmessaging/generated.json @@ -72,6 +72,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/chimesdkmessaging/sra_operation_order_test.go b/service/chimesdkmessaging/sra_operation_order_test.go new file mode 100644 index 00000000000..ea19a0eaf73 --- /dev/null +++ b/service/chimesdkmessaging/sra_operation_order_test.go @@ -0,0 +1,1806 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkmessaging + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateChannelFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateChannelFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchCreateChannelMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchCreateChannelMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpChannelFlowCallbackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ChannelFlowCallback(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateChannelBanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateChannelBan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateChannelFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateChannelFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateChannelMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateChannelMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateChannelModeratorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateChannelModerator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteChannelBanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteChannelBan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteChannelFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteChannelFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteChannelMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteChannelMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteChannelMessageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteChannelMessage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteChannelModeratorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteChannelModerator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMessagingStreamingConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMessagingStreamingConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeChannelBanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeChannelBan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeChannelFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeChannelFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeChannelMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeChannelMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeChannelMembershipForAppInstanceUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeChannelMembershipForAppInstanceUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeChannelModeratedByAppInstanceUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeChannelModeratedByAppInstanceUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeChannelModeratorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeChannelModerator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateChannelFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateChannelFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetChannelMembershipPreferencesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetChannelMembershipPreferences(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetChannelMessageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetChannelMessage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetChannelMessageStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetChannelMessageStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMessagingSessionEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMessagingSessionEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMessagingStreamingConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMessagingStreamingConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListChannelBansSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListChannelBans(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListChannelFlowsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListChannelFlows(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListChannelMembershipsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListChannelMemberships(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListChannelMembershipsForAppInstanceUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListChannelMembershipsForAppInstanceUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListChannelMessagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListChannelMessages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListChannelModeratorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListChannelModerators(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListChannelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListChannels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListChannelsAssociatedWithChannelFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListChannelsAssociatedWithChannelFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListChannelsModeratedByAppInstanceUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListChannelsModeratedByAppInstanceUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSubChannelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSubChannels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutChannelExpirationSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutChannelExpirationSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutChannelMembershipPreferencesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutChannelMembershipPreferences(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutMessagingStreamingConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutMessagingStreamingConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRedactChannelMessageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RedactChannelMessage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchChannelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchChannels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendChannelMessageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendChannelMessage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateChannelFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateChannelFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateChannelMessageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateChannelMessage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateChannelReadMarkerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateChannelReadMarker(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/chimesdkvoice/generated.json b/service/chimesdkvoice/generated.json index b62f0c782bb..01ceda4f766 100644 --- a/service/chimesdkvoice/generated.json +++ b/service/chimesdkvoice/generated.json @@ -117,6 +117,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/chimesdkvoice/sra_operation_order_test.go b/service/chimesdkvoice/sra_operation_order_test.go new file mode 100644 index 00000000000..f7f4a4c1124 --- /dev/null +++ b/service/chimesdkvoice/sra_operation_order_test.go @@ -0,0 +1,3381 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociatePhoneNumbersWithVoiceConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociatePhoneNumbersWithVoiceConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociatePhoneNumbersWithVoiceConnectorGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociatePhoneNumbersWithVoiceConnectorGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeletePhoneNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeletePhoneNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchUpdatePhoneNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchUpdatePhoneNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePhoneNumberOrderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePhoneNumberOrder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProxySessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProxySession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSipMediaApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSipMediaApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSipMediaApplicationCallSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSipMediaApplicationCall(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSipRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSipRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVoiceConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVoiceConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVoiceConnectorGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVoiceConnectorGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVoiceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVoiceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVoiceProfileDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVoiceProfileDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePhoneNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePhoneNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProxySessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProxySession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSipMediaApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSipMediaApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSipRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSipRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVoiceConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVoiceConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVoiceConnectorEmergencyCallingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVoiceConnectorEmergencyCallingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVoiceConnectorExternalSystemsConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVoiceConnectorExternalSystemsConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVoiceConnectorGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVoiceConnectorGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVoiceConnectorOriginationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVoiceConnectorOrigination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVoiceConnectorProxySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVoiceConnectorProxy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVoiceConnectorStreamingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVoiceConnectorStreamingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVoiceConnectorTerminationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVoiceConnectorTermination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVoiceConnectorTerminationCredentialsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVoiceConnectorTerminationCredentials(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVoiceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVoiceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVoiceProfileDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVoiceProfileDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociatePhoneNumbersFromVoiceConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociatePhoneNumbersFromVoiceConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociatePhoneNumbersFromVoiceConnectorGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociatePhoneNumbersFromVoiceConnectorGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGlobalSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGlobalSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPhoneNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPhoneNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPhoneNumberOrderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPhoneNumberOrder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPhoneNumberSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPhoneNumberSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetProxySessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetProxySession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSipMediaApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSipMediaApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSipMediaApplicationAlexaSkillConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSipMediaApplicationAlexaSkillConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSipMediaApplicationLoggingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSipMediaApplicationLoggingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSipRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSipRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSpeakerSearchTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSpeakerSearchTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVoiceConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVoiceConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVoiceConnectorEmergencyCallingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVoiceConnectorEmergencyCallingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVoiceConnectorExternalSystemsConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVoiceConnectorExternalSystemsConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVoiceConnectorGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVoiceConnectorGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVoiceConnectorLoggingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVoiceConnectorLoggingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVoiceConnectorOriginationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVoiceConnectorOrigination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVoiceConnectorProxySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVoiceConnectorProxy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVoiceConnectorStreamingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVoiceConnectorStreamingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVoiceConnectorTerminationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVoiceConnectorTermination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVoiceConnectorTerminationHealthSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVoiceConnectorTerminationHealth(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVoiceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVoiceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVoiceProfileDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVoiceProfileDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVoiceToneAnalysisTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVoiceToneAnalysisTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAvailableVoiceConnectorRegionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAvailableVoiceConnectorRegions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPhoneNumberOrdersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPhoneNumberOrders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPhoneNumbersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPhoneNumbers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProxySessionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProxySessions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSipMediaApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSipMediaApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSipRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSipRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSupportedPhoneNumberCountriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSupportedPhoneNumberCountries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVoiceConnectorGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVoiceConnectorGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVoiceConnectorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVoiceConnectors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVoiceConnectorTerminationCredentialsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVoiceConnectorTerminationCredentials(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVoiceProfileDomainsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVoiceProfileDomains(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVoiceProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVoiceProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutSipMediaApplicationAlexaSkillConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutSipMediaApplicationAlexaSkillConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutSipMediaApplicationLoggingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutSipMediaApplicationLoggingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutVoiceConnectorEmergencyCallingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutVoiceConnectorEmergencyCallingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutVoiceConnectorExternalSystemsConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutVoiceConnectorExternalSystemsConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutVoiceConnectorLoggingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutVoiceConnectorLoggingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutVoiceConnectorOriginationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutVoiceConnectorOrigination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutVoiceConnectorProxySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutVoiceConnectorProxy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutVoiceConnectorStreamingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutVoiceConnectorStreamingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutVoiceConnectorTerminationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutVoiceConnectorTermination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutVoiceConnectorTerminationCredentialsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutVoiceConnectorTerminationCredentials(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestorePhoneNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestorePhoneNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchAvailablePhoneNumbersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchAvailablePhoneNumbers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartSpeakerSearchTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartSpeakerSearchTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartVoiceToneAnalysisTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartVoiceToneAnalysisTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopSpeakerSearchTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopSpeakerSearchTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopVoiceToneAnalysisTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopVoiceToneAnalysisTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGlobalSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGlobalSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePhoneNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePhoneNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePhoneNumberSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePhoneNumberSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProxySessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProxySession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSipMediaApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSipMediaApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSipMediaApplicationCallSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSipMediaApplicationCall(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSipRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSipRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVoiceConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVoiceConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVoiceConnectorGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVoiceConnectorGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVoiceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVoiceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVoiceProfileDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVoiceProfileDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpValidateE911AddressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ValidateE911Address(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/cleanrooms/generated.json b/service/cleanrooms/generated.json index 8e69c75c825..933119a07a5 100644 --- a/service/cleanrooms/generated.json +++ b/service/cleanrooms/generated.json @@ -105,6 +105,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/cleanrooms/sra_operation_order_test.go b/service/cleanrooms/sra_operation_order_test.go new file mode 100644 index 00000000000..c18bfc9ccb8 --- /dev/null +++ b/service/cleanrooms/sra_operation_order_test.go @@ -0,0 +1,2821 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cleanrooms + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchGetCollaborationAnalysisTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetCollaborationAnalysisTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetSchemaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetSchema(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetSchemaAnalysisRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetSchemaAnalysisRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAnalysisTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAnalysisTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCollaborationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCollaboration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConfiguredAudienceModelAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConfiguredAudienceModelAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConfiguredTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConfiguredTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConfiguredTableAnalysisRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConfiguredTableAnalysisRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConfiguredTableAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConfiguredTableAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConfiguredTableAssociationAnalysisRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConfiguredTableAssociationAnalysisRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIdMappingTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIdMappingTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIdNamespaceAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIdNamespaceAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePrivacyBudgetTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePrivacyBudgetTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAnalysisTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAnalysisTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCollaborationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCollaboration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConfiguredAudienceModelAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConfiguredAudienceModelAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConfiguredTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConfiguredTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConfiguredTableAnalysisRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConfiguredTableAnalysisRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConfiguredTableAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConfiguredTableAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConfiguredTableAssociationAnalysisRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConfiguredTableAssociationAnalysisRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIdMappingTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIdMappingTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIdNamespaceAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIdNamespaceAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMemberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMember(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePrivacyBudgetTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePrivacyBudgetTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAnalysisTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAnalysisTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCollaborationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCollaboration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCollaborationAnalysisTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCollaborationAnalysisTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCollaborationConfiguredAudienceModelAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCollaborationConfiguredAudienceModelAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCollaborationIdNamespaceAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCollaborationIdNamespaceAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCollaborationPrivacyBudgetTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCollaborationPrivacyBudgetTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConfiguredAudienceModelAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConfiguredAudienceModelAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConfiguredTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConfiguredTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConfiguredTableAnalysisRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConfiguredTableAnalysisRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConfiguredTableAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConfiguredTableAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConfiguredTableAssociationAnalysisRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConfiguredTableAssociationAnalysisRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIdMappingTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIdMappingTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIdNamespaceAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIdNamespaceAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPrivacyBudgetTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPrivacyBudgetTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetProtectedQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetProtectedQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSchemaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSchema(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSchemaAnalysisRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSchemaAnalysisRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAnalysisTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAnalysisTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCollaborationAnalysisTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCollaborationAnalysisTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCollaborationConfiguredAudienceModelAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCollaborationConfiguredAudienceModelAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCollaborationIdNamespaceAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCollaborationIdNamespaceAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCollaborationPrivacyBudgetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCollaborationPrivacyBudgets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCollaborationPrivacyBudgetTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCollaborationPrivacyBudgetTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCollaborationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCollaborations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConfiguredAudienceModelAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConfiguredAudienceModelAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConfiguredTableAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConfiguredTableAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConfiguredTablesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConfiguredTables(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIdMappingTablesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIdMappingTables(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIdNamespaceAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIdNamespaceAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMembershipsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMemberships(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPrivacyBudgetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPrivacyBudgets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPrivacyBudgetTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPrivacyBudgetTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProtectedQueriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProtectedQueries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSchemasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSchemas(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPopulateIdMappingTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PopulateIdMappingTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPreviewPrivacyImpactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PreviewPrivacyImpact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartProtectedQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartProtectedQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAnalysisTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAnalysisTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCollaborationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCollaboration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConfiguredAudienceModelAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConfiguredAudienceModelAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConfiguredTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConfiguredTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConfiguredTableAnalysisRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConfiguredTableAnalysisRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConfiguredTableAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConfiguredTableAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConfiguredTableAssociationAnalysisRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConfiguredTableAssociationAnalysisRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIdMappingTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIdMappingTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIdNamespaceAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIdNamespaceAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePrivacyBudgetTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePrivacyBudgetTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProtectedQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProtectedQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/cleanroomsml/generated.json b/service/cleanroomsml/generated.json index 6fab22e0a4a..9092b4ef58a 100644 --- a/service/cleanroomsml/generated.json +++ b/service/cleanroomsml/generated.json @@ -79,6 +79,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/cleanroomsml/sra_operation_order_test.go b/service/cleanroomsml/sra_operation_order_test.go new file mode 100644 index 00000000000..800b0e2f571 --- /dev/null +++ b/service/cleanroomsml/sra_operation_order_test.go @@ -0,0 +1,2051 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cleanroomsml + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCancelTrainedModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelTrainedModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelTrainedModelInferenceJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelTrainedModelInferenceJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAudienceModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAudienceModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConfiguredAudienceModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConfiguredAudienceModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConfiguredModelAlgorithmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConfiguredModelAlgorithm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConfiguredModelAlgorithmAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConfiguredModelAlgorithmAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMLInputChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMLInputChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTrainedModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTrainedModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTrainingDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTrainingDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAudienceGenerationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAudienceGenerationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAudienceModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAudienceModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConfiguredAudienceModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConfiguredAudienceModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConfiguredAudienceModelPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConfiguredAudienceModelPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConfiguredModelAlgorithmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConfiguredModelAlgorithm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConfiguredModelAlgorithmAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConfiguredModelAlgorithmAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMLConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMLConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMLInputChannelDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMLInputChannelData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTrainedModelOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTrainedModelOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTrainingDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTrainingDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAudienceGenerationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAudienceGenerationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAudienceModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAudienceModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCollaborationConfiguredModelAlgorithmAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCollaborationConfiguredModelAlgorithmAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCollaborationMLInputChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCollaborationMLInputChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCollaborationTrainedModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCollaborationTrainedModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConfiguredAudienceModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConfiguredAudienceModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConfiguredAudienceModelPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConfiguredAudienceModelPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConfiguredModelAlgorithmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConfiguredModelAlgorithm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConfiguredModelAlgorithmAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConfiguredModelAlgorithmAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMLConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMLConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMLInputChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMLInputChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTrainedModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTrainedModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTrainedModelInferenceJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTrainedModelInferenceJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTrainingDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTrainingDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAudienceExportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAudienceExportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAudienceGenerationJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAudienceGenerationJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAudienceModelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAudienceModels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCollaborationConfiguredModelAlgorithmAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCollaborationConfiguredModelAlgorithmAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCollaborationMLInputChannelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCollaborationMLInputChannels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCollaborationTrainedModelExportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCollaborationTrainedModelExportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCollaborationTrainedModelInferenceJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCollaborationTrainedModelInferenceJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCollaborationTrainedModelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCollaborationTrainedModels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConfiguredAudienceModelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConfiguredAudienceModels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConfiguredModelAlgorithmAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConfiguredModelAlgorithmAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConfiguredModelAlgorithmsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConfiguredModelAlgorithms(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMLInputChannelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMLInputChannels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTrainedModelInferenceJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTrainedModelInferenceJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTrainedModelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTrainedModels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTrainingDatasetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTrainingDatasets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutConfiguredAudienceModelPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutConfiguredAudienceModelPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutMLConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutMLConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartAudienceExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartAudienceExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartAudienceGenerationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartAudienceGenerationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartTrainedModelExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartTrainedModelExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartTrainedModelInferenceJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartTrainedModelInferenceJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConfiguredAudienceModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConfiguredAudienceModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/cloud9/generated.json b/service/cloud9/generated.json index 72f7b26e89a..b642cfe0004 100644 --- a/service/cloud9/generated.json +++ b/service/cloud9/generated.json @@ -34,6 +34,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/cloud9/sra_operation_order_test.go b/service/cloud9/sra_operation_order_test.go new file mode 100644 index 00000000000..331625be3cd --- /dev/null +++ b/service/cloud9/sra_operation_order_test.go @@ -0,0 +1,476 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloud9 + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateEnvironmentEC2SRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEnvironmentEC2(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEnvironmentMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEnvironmentMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEnvironmentMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEnvironmentMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEnvironmentMembershipsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEnvironmentMemberships(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEnvironmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEnvironments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEnvironmentStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEnvironmentStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEnvironmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEnvironments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEnvironmentMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEnvironmentMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/cloudcontrol/generated.json b/service/cloudcontrol/generated.json index f5bfad80f78..10496445eeb 100644 --- a/service/cloudcontrol/generated.json +++ b/service/cloudcontrol/generated.json @@ -29,6 +29,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/cloudcontrol/sra_operation_order_test.go b/service/cloudcontrol/sra_operation_order_test.go new file mode 100644 index 00000000000..dcab067b69e --- /dev/null +++ b/service/cloudcontrol/sra_operation_order_test.go @@ -0,0 +1,301 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudcontrol + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCancelResourceRequestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelResourceRequest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourceRequestStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourceRequestStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceRequestsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceRequests(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/clouddirectory/generated.json b/service/clouddirectory/generated.json index b87ee9fcadc..1a0682005ee 100644 --- a/service/clouddirectory/generated.json +++ b/service/clouddirectory/generated.json @@ -87,6 +87,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/clouddirectory/sra_operation_order_test.go b/service/clouddirectory/sra_operation_order_test.go new file mode 100644 index 00000000000..925a0757237 --- /dev/null +++ b/service/clouddirectory/sra_operation_order_test.go @@ -0,0 +1,2331 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package clouddirectory + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddFacetToObjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddFacetToObject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpApplySchemaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ApplySchema(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachObjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachObject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachToIndexSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachToIndex(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachTypedLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachTypedLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchReadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchRead(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchWriteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchWrite(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDirectorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDirectory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFacetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFacet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIndexSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIndex(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateObjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateObject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSchemaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSchema(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTypedLinkFacetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTypedLinkFacet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDirectorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDirectory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFacetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFacet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteObjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteObject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSchemaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSchema(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTypedLinkFacetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTypedLinkFacet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachFromIndexSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachFromIndex(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachObjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachObject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachTypedLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachTypedLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableDirectorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableDirectory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableDirectorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableDirectory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAppliedSchemaVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAppliedSchemaVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDirectorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDirectory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFacetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFacet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLinkAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLinkAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetObjectAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetObjectAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetObjectInformationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetObjectInformation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSchemaAsJsonSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSchemaAsJson(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTypedLinkFacetInformationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTypedLinkFacetInformation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAppliedSchemaArnsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAppliedSchemaArns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAttachedIndicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAttachedIndices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDevelopmentSchemaArnsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDevelopmentSchemaArns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDirectoriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDirectories(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFacetAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFacetAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFacetNamesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFacetNames(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIncomingTypedLinksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIncomingTypedLinks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIndexSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIndex(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListManagedSchemaArnsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListManagedSchemaArns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListObjectAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListObjectAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListObjectChildrenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListObjectChildren(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListObjectParentPathsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListObjectParentPaths(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListObjectParentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListObjectParents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListObjectPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListObjectPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOutgoingTypedLinksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOutgoingTypedLinks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPolicyAttachmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPolicyAttachments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPublishedSchemaArnsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPublishedSchemaArns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTypedLinkFacetAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTypedLinkFacetAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTypedLinkFacetNamesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTypedLinkFacetNames(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpLookupPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.LookupPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPublishSchemaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PublishSchema(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutSchemaFromJsonSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutSchemaFromJson(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveFacetFromObjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveFacetFromObject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFacetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFacet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLinkAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLinkAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateObjectAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateObjectAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSchemaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSchema(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTypedLinkFacetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTypedLinkFacet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpgradeAppliedSchemaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpgradeAppliedSchema(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpgradePublishedSchemaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpgradePublishedSchema(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/cloudformation/generated.json b/service/cloudformation/generated.json index 35d909061ce..3a4392a39cb 100644 --- a/service/cloudformation/generated.json +++ b/service/cloudformation/generated.json @@ -109,6 +109,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/cloudformation/sra_operation_order_test.go b/service/cloudformation/sra_operation_order_test.go new file mode 100644 index 00000000000..1d16b2ef21a --- /dev/null +++ b/service/cloudformation/sra_operation_order_test.go @@ -0,0 +1,3101 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudformation + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpActivateOrganizationsAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ActivateOrganizationsAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpActivateTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ActivateType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDescribeTypeConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDescribeTypeConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelUpdateStackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelUpdateStack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpContinueUpdateRollbackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ContinueUpdateRollback(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateChangeSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateChangeSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGeneratedTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGeneratedTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStackInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStackInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStackRefactorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStackRefactor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStackSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStackSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeactivateOrganizationsAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeactivateOrganizationsAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeactivateTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeactivateType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteChangeSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteChangeSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGeneratedTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGeneratedTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteStackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteStack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteStackInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteStackInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteStackSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteStackSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccountLimitsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccountLimits(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeChangeSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeChangeSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeChangeSetHooksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeChangeSetHooks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGeneratedTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGeneratedTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOrganizationsAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOrganizationsAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePublisherSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePublisher(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeResourceScanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeResourceScan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStackDriftDetectionStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStackDriftDetectionStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStackEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStackEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStackInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStackInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStackRefactorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStackRefactor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStackResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStackResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStackResourceDriftsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStackResourceDrifts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStackResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStackResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStacksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStacks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStackSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStackSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStackSetOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStackSetOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTypeRegistrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTypeRegistration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetectStackDriftSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetectStackDrift(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetectStackResourceDriftSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetectStackResourceDrift(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetectStackSetDriftSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetectStackSetDrift(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEstimateTemplateCostSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EstimateTemplateCost(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExecuteChangeSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExecuteChangeSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExecuteStackRefactorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExecuteStackRefactor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGeneratedTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGeneratedTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStackPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStackPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTemplateSummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTemplateSummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportStacksToStackSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportStacksToStackSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListChangeSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListChangeSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListExportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListExports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGeneratedTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGeneratedTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListHookResultsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListHookResults(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListImportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListImports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceScanRelatedResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceScanRelatedResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceScanResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceScanResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceScansSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceScans(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStackInstanceResourceDriftsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStackInstanceResourceDrifts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStackInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStackInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStackRefactorActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStackRefactorActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStackRefactorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStackRefactors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStackResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStackResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStacksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStacks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStackSetAutoDeploymentTargetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStackSetAutoDeploymentTargets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStackSetOperationResultsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStackSetOperationResults(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStackSetOperationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStackSetOperations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStackSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStackSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTypeRegistrationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTypeRegistrations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTypeVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTypeVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPublishTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PublishType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRecordHandlerProgressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RecordHandlerProgress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterPublisherSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterPublisher(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRollbackStackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RollbackStack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetStackPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetStackPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetTypeConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetTypeConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetTypeDefaultVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetTypeDefaultVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSignalResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SignalResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartResourceScanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartResourceScan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopStackSetOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopStackSetOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGeneratedTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGeneratedTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateStackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateStack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateStackInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateStackInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateStackSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateStackSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTerminationProtectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTerminationProtection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpValidateTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ValidateTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/cloudfront/generated.json b/service/cloudfront/generated.json index 5c7b04a4422..83c9dee8cae 100644 --- a/service/cloudfront/generated.json +++ b/service/cloudfront/generated.json @@ -143,6 +143,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/cloudfront/sra_operation_order_test.go b/service/cloudfront/sra_operation_order_test.go new file mode 100644 index 00000000000..238d79b84d0 --- /dev/null +++ b/service/cloudfront/sra_operation_order_test.go @@ -0,0 +1,4291 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfront + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCopyDistributionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopyDistribution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAnycastIpListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAnycastIpList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCachePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCachePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCloudFrontOriginAccessIdentitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCloudFrontOriginAccessIdentity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateContinuousDeploymentPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateContinuousDeploymentPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDistributionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDistribution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDistributionWithTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDistributionWithTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFieldLevelEncryptionConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFieldLevelEncryptionConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFieldLevelEncryptionProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFieldLevelEncryptionProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFunctionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFunction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInvalidationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInvalidation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateKeyGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateKeyGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateKeyValueStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateKeyValueStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMonitoringSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMonitoringSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateOriginAccessControlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateOriginAccessControl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateOriginRequestPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateOriginRequestPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePublicKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePublicKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRealtimeLogConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRealtimeLogConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateResponseHeadersPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateResponseHeadersPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStreamingDistributionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStreamingDistribution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStreamingDistributionWithTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStreamingDistributionWithTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVpcOriginSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVpcOrigin(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAnycastIpListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAnycastIpList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCachePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCachePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCloudFrontOriginAccessIdentitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCloudFrontOriginAccessIdentity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteContinuousDeploymentPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteContinuousDeploymentPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDistributionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDistribution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFieldLevelEncryptionConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFieldLevelEncryptionConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFieldLevelEncryptionProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFieldLevelEncryptionProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFunctionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFunction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteKeyGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteKeyGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteKeyValueStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteKeyValueStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMonitoringSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMonitoringSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteOriginAccessControlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteOriginAccessControl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteOriginRequestPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteOriginRequestPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePublicKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePublicKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRealtimeLogConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRealtimeLogConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResponseHeadersPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResponseHeadersPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteStreamingDistributionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteStreamingDistribution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVpcOriginSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVpcOrigin(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFunctionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFunction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeKeyValueStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeKeyValueStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAnycastIpListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAnycastIpList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCachePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCachePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCachePolicyConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCachePolicyConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCloudFrontOriginAccessIdentitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCloudFrontOriginAccessIdentity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCloudFrontOriginAccessIdentityConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCloudFrontOriginAccessIdentityConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetContinuousDeploymentPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetContinuousDeploymentPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetContinuousDeploymentPolicyConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetContinuousDeploymentPolicyConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDistributionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDistribution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDistributionConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDistributionConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFieldLevelEncryptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFieldLevelEncryption(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFieldLevelEncryptionConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFieldLevelEncryptionConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFieldLevelEncryptionProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFieldLevelEncryptionProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFieldLevelEncryptionProfileConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFieldLevelEncryptionProfileConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFunctionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFunction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInvalidationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInvalidation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetKeyGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetKeyGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetKeyGroupConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetKeyGroupConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMonitoringSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMonitoringSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOriginAccessControlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOriginAccessControl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOriginAccessControlConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOriginAccessControlConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOriginRequestPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOriginRequestPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOriginRequestPolicyConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOriginRequestPolicyConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPublicKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPublicKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPublicKeyConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPublicKeyConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRealtimeLogConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRealtimeLogConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResponseHeadersPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResponseHeadersPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResponseHeadersPolicyConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResponseHeadersPolicyConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStreamingDistributionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStreamingDistribution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStreamingDistributionConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStreamingDistributionConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVpcOriginSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVpcOrigin(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAnycastIpListsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAnycastIpLists(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCachePoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCachePolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCloudFrontOriginAccessIdentitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCloudFrontOriginAccessIdentities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConflictingAliasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConflictingAliases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListContinuousDeploymentPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListContinuousDeploymentPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDistributionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDistributions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDistributionsByAnycastIpListIdSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDistributionsByAnycastIpListId(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDistributionsByCachePolicyIdSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDistributionsByCachePolicyId(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDistributionsByKeyGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDistributionsByKeyGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDistributionsByOriginRequestPolicyIdSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDistributionsByOriginRequestPolicyId(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDistributionsByRealtimeLogConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDistributionsByRealtimeLogConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDistributionsByResponseHeadersPolicyIdSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDistributionsByResponseHeadersPolicyId(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDistributionsByVpcOriginIdSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDistributionsByVpcOriginId(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDistributionsByWebACLIdSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDistributionsByWebACLId(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFieldLevelEncryptionConfigsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFieldLevelEncryptionConfigs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFieldLevelEncryptionProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFieldLevelEncryptionProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFunctionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFunctions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInvalidationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInvalidations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListKeyGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListKeyGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListKeyValueStoresSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListKeyValueStores(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOriginAccessControlsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOriginAccessControls(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOriginRequestPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOriginRequestPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPublicKeysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPublicKeys(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRealtimeLogConfigsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRealtimeLogConfigs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResponseHeadersPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResponseHeadersPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStreamingDistributionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStreamingDistributions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVpcOriginsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVpcOrigins(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPublishFunctionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PublishFunction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestFunctionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestFunction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCachePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCachePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCloudFrontOriginAccessIdentitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCloudFrontOriginAccessIdentity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateContinuousDeploymentPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateContinuousDeploymentPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDistributionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDistribution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDistributionWithStagingConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDistributionWithStagingConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFieldLevelEncryptionConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFieldLevelEncryptionConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFieldLevelEncryptionProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFieldLevelEncryptionProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFunctionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFunction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateKeyGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateKeyGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateKeyValueStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateKeyValueStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateOriginAccessControlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateOriginAccessControl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateOriginRequestPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateOriginRequestPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePublicKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePublicKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRealtimeLogConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRealtimeLogConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateResponseHeadersPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateResponseHeadersPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateStreamingDistributionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateStreamingDistribution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVpcOriginSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVpcOrigin(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/cloudfrontkeyvaluestore/generated.json b/service/cloudfrontkeyvaluestore/generated.json index 5673bc9c8c7..749cf72e082 100644 --- a/service/cloudfrontkeyvaluestore/generated.json +++ b/service/cloudfrontkeyvaluestore/generated.json @@ -28,6 +28,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/errors.go", "types/types.go", "validators.go" diff --git a/service/cloudfrontkeyvaluestore/sra_operation_order_test.go b/service/cloudfrontkeyvaluestore/sra_operation_order_test.go new file mode 100644 index 00000000000..9e82278dfd1 --- /dev/null +++ b/service/cloudfrontkeyvaluestore/sra_operation_order_test.go @@ -0,0 +1,231 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfrontkeyvaluestore + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpDeleteKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeKeyValueStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeKeyValueStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListKeysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListKeys(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateKeysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateKeys(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/cloudhsm/generated.json b/service/cloudhsm/generated.json index 1ab9c0d1788..3017602560f 100644 --- a/service/cloudhsm/generated.json +++ b/service/cloudhsm/generated.json @@ -41,6 +41,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/cloudhsm/sra_operation_order_test.go b/service/cloudhsm/sra_operation_order_test.go new file mode 100644 index 00000000000..b9815f6dab1 --- /dev/null +++ b/service/cloudhsm/sra_operation_order_test.go @@ -0,0 +1,721 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudhsm + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddTagsToResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddTagsToResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateHapgSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateHapg(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateHsmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateHsm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLunaClientSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLunaClient(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteHapgSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteHapg(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteHsmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteHsm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLunaClientSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLunaClient(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeHapgSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeHapg(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeHsmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeHsm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLunaClientSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLunaClient(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAvailableZonesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAvailableZones(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListHapgsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListHapgs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListHsmsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListHsms(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLunaClientsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLunaClients(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyHapgSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyHapg(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyHsmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyHsm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyLunaClientSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyLunaClient(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveTagsFromResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveTagsFromResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/cloudhsmv2/generated.json b/service/cloudhsmv2/generated.json index acb6cdeec8c..59ad7ba8811 100644 --- a/service/cloudhsmv2/generated.json +++ b/service/cloudhsmv2/generated.json @@ -39,6 +39,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/cloudhsmv2/sra_operation_order_test.go b/service/cloudhsmv2/sra_operation_order_test.go new file mode 100644 index 00000000000..f81866b8bcf --- /dev/null +++ b/service/cloudhsmv2/sra_operation_order_test.go @@ -0,0 +1,651 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudhsmv2 + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCopyBackupToRegionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopyBackupToRegion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateHsmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateHsm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBackupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBackup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteHsmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteHsm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBackupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBackups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInitializeClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InitializeCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyBackupAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyBackupAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreBackupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreBackup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/cloudsearch/generated.json b/service/cloudsearch/generated.json index a46d02d8bff..2cf920bf12a 100644 --- a/service/cloudsearch/generated.json +++ b/service/cloudsearch/generated.json @@ -47,6 +47,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/cloudsearch/sra_operation_order_test.go b/service/cloudsearch/sra_operation_order_test.go new file mode 100644 index 00000000000..3f1a2c44831 --- /dev/null +++ b/service/cloudsearch/sra_operation_order_test.go @@ -0,0 +1,931 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudsearch + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBuildSuggestersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BuildSuggesters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDefineAnalysisSchemeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DefineAnalysisScheme(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDefineExpressionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DefineExpression(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDefineIndexFieldSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DefineIndexField(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDefineSuggesterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DefineSuggester(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAnalysisSchemeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAnalysisScheme(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteExpressionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteExpression(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIndexFieldSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIndexField(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSuggesterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSuggester(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAnalysisSchemesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAnalysisSchemes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAvailabilityOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAvailabilityOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDomainEndpointOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDomainEndpointOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDomainsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDomains(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeExpressionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeExpressions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIndexFieldsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIndexFields(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeScalingParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeScalingParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeServiceAccessPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeServiceAccessPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSuggestersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSuggesters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpIndexDocumentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.IndexDocuments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDomainNamesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDomainNames(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAvailabilityOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAvailabilityOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDomainEndpointOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDomainEndpointOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateScalingParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateScalingParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateServiceAccessPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateServiceAccessPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/cloudsearchdomain/generated.json b/service/cloudsearchdomain/generated.json index 62a5893de3b..57f2ed16332 100644 --- a/service/cloudsearchdomain/generated.json +++ b/service/cloudsearchdomain/generated.json @@ -24,6 +24,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/cloudsearchdomain/sra_operation_order_test.go b/service/cloudsearchdomain/sra_operation_order_test.go new file mode 100644 index 00000000000..7b22f382d40 --- /dev/null +++ b/service/cloudsearchdomain/sra_operation_order_test.go @@ -0,0 +1,126 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudsearchdomain + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpSearchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Search(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSuggestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Suggest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUploadDocumentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UploadDocuments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/cloudtrail/generated.json b/service/cloudtrail/generated.json index ff34b3919ba..94752d163e6 100644 --- a/service/cloudtrail/generated.json +++ b/service/cloudtrail/generated.json @@ -78,6 +78,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/cloudtrail/sra_operation_order_test.go b/service/cloudtrail/sra_operation_order_test.go new file mode 100644 index 00000000000..042fe8ad32e --- /dev/null +++ b/service/cloudtrail/sra_operation_order_test.go @@ -0,0 +1,2016 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudtrail + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDashboardSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDashboard(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEventDataStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEventDataStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTrailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTrail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDashboardSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDashboard(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEventDataStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEventDataStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTrailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTrail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterOrganizationDelegatedAdminSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterOrganizationDelegatedAdmin(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTrailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTrails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableFederationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableFederation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableFederationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableFederation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGenerateQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GenerateQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDashboardSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDashboard(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEventDataStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEventDataStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEventSelectorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEventSelectors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetImportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetImport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInsightSelectorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInsightSelectors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQueryResultsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQueryResults(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTrailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTrail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTrailStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTrailStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListChannelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListChannels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDashboardsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDashboards(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEventDataStoresSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEventDataStores(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListImportFailuresSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListImportFailures(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListImportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListImports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInsightsMetricDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInsightsMetricData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPublicKeysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPublicKeys(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListQueriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListQueries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTrailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTrails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpLookupEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.LookupEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutEventSelectorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutEventSelectors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutInsightSelectorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutInsightSelectors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterOrganizationDelegatedAdminSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterOrganizationDelegatedAdmin(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreEventDataStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreEventDataStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchSampleQueriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchSampleQueries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDashboardRefreshSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDashboardRefresh(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartEventDataStoreIngestionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartEventDataStoreIngestion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartImportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartImport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartLoggingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartLogging(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopEventDataStoreIngestionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopEventDataStoreIngestion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopImportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopImport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopLoggingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopLogging(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDashboardSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDashboard(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEventDataStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEventDataStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTrailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTrail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/cloudtraildata/generated.json b/service/cloudtraildata/generated.json index 8fb9d325f2b..53877e0d4e9 100644 --- a/service/cloudtraildata/generated.json +++ b/service/cloudtraildata/generated.json @@ -22,6 +22,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/errors.go", "types/types.go", "validators.go" diff --git a/service/cloudtraildata/sra_operation_order_test.go b/service/cloudtraildata/sra_operation_order_test.go new file mode 100644 index 00000000000..bfa7c99cf71 --- /dev/null +++ b/service/cloudtraildata/sra_operation_order_test.go @@ -0,0 +1,56 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudtraildata + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpPutAuditEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAuditEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/cloudwatch/generated.json b/service/cloudwatch/generated.json index 26b25a54793..e1623f24d4c 100644 --- a/service/cloudwatch/generated.json +++ b/service/cloudwatch/generated.json @@ -59,6 +59,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/cloudwatch/sra_operation_order_test.go b/service/cloudwatch/sra_operation_order_test.go new file mode 100644 index 00000000000..99c5f0aea73 --- /dev/null +++ b/service/cloudwatch/sra_operation_order_test.go @@ -0,0 +1,1351 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatch + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpDeleteAlarmsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAlarms(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAnomalyDetectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAnomalyDetector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDashboardsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDashboards(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInsightRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInsightRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMetricStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMetricStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAlarmHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAlarmHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAlarmsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAlarms(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAlarmsForMetricSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAlarmsForMetric(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAnomalyDetectorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAnomalyDetectors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInsightRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInsightRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableAlarmActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableAlarmActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableInsightRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableInsightRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableAlarmActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableAlarmActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableInsightRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableInsightRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDashboardSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDashboard(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInsightRuleReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInsightRuleReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMetricDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMetricData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMetricStatisticsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMetricStatistics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMetricStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMetricStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMetricWidgetImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMetricWidgetImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDashboardsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDashboards(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListManagedInsightRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListManagedInsightRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMetricsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMetrics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMetricStreamsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMetricStreams(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAnomalyDetectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAnomalyDetector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutCompositeAlarmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutCompositeAlarm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutDashboardSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutDashboard(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutInsightRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutInsightRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutManagedInsightRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutManagedInsightRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutMetricAlarmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutMetricAlarm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutMetricDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutMetricData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutMetricStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutMetricStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetAlarmStateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetAlarmState(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMetricStreamsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMetricStreams(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopMetricStreamsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopMetricStreams(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/cloudwatchevents/generated.json b/service/cloudwatchevents/generated.json index 52c87773c51..a91b074ab35 100644 --- a/service/cloudwatchevents/generated.json +++ b/service/cloudwatchevents/generated.json @@ -72,6 +72,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/cloudwatchevents/sra_operation_order_test.go b/service/cloudwatchevents/sra_operation_order_test.go new file mode 100644 index 00000000000..be31f1a3fd2 --- /dev/null +++ b/service/cloudwatchevents/sra_operation_order_test.go @@ -0,0 +1,1806 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchevents + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpActivateEventSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ActivateEventSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelReplaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelReplay(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateApiDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApiDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateArchiveSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateArchive(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEventBusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEventBus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePartnerEventSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePartnerEventSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeactivateEventSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeactivateEventSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeauthorizeConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeauthorizeConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApiDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApiDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteArchiveSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteArchive(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEventBusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEventBus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePartnerEventSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePartnerEventSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeApiDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeApiDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeArchiveSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeArchive(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventBusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEventBus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEventSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePartnerEventSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePartnerEventSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReplaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReplay(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApiDestinationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApiDestinations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListArchivesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListArchives(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConnectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConnections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEventBusesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEventBuses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEventSourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEventSources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPartnerEventSourceAccountsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPartnerEventSourceAccounts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPartnerEventSourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPartnerEventSources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReplaysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReplays(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRuleNamesByTargetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRuleNamesByTarget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTargetsByRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTargetsByRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutPartnerEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutPartnerEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutPermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutPermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutTargetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutTargets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemovePermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemovePermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveTargetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveTargets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartReplaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartReplay(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestEventPatternSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestEventPattern(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApiDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApiDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateArchiveSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateArchive(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/cloudwatchlogs/generated.json b/service/cloudwatchlogs/generated.json index cb18216dab3..9818c5717db 100644 --- a/service/cloudwatchlogs/generated.json +++ b/service/cloudwatchlogs/generated.json @@ -112,6 +112,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/cloudwatchlogs/sra_operation_order_test.go b/service/cloudwatchlogs/sra_operation_order_test.go new file mode 100644 index 00000000000..b78f430ce5b --- /dev/null +++ b/service/cloudwatchlogs/sra_operation_order_test.go @@ -0,0 +1,3136 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateKmsKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateKmsKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelExportTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelExportTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDeliverySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDelivery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateExportTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateExportTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLogAnomalyDetectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLogAnomalyDetector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLogGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLogGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLogStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLogStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccountPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccountPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataProtectionPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataProtectionPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDeliverySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDelivery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDeliveryDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDeliveryDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDeliveryDestinationPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDeliveryDestinationPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDeliverySourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDeliverySource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIndexPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIndexPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLogAnomalyDetectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLogAnomalyDetector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLogGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLogGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLogStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLogStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMetricFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMetricFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteQueryDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteQueryDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRetentionPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRetentionPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSubscriptionFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSubscriptionFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTransformerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTransformer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccountPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccountPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConfigurationTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConfigurationTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDeliveriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDeliveries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDeliveryDestinationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDeliveryDestinations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDeliverySourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDeliverySources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDestinationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDestinations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeExportTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeExportTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFieldIndexesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFieldIndexes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIndexPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIndexPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLogGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLogGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLogStreamsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLogStreams(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMetricFiltersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMetricFilters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeQueriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeQueries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeQueryDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeQueryDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeResourcePoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeResourcePolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSubscriptionFiltersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSubscriptionFilters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateKmsKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateKmsKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpFilterLogEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.FilterLogEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataProtectionPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataProtectionPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeliverySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDelivery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeliveryDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeliveryDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeliveryDestinationPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeliveryDestinationPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeliverySourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeliverySource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLogAnomalyDetectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLogAnomalyDetector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLogEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLogEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLogGroupFieldsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLogGroupFields(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLogRecordSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLogRecord(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQueryResultsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQueryResults(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTransformerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTransformer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAnomaliesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAnomalies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIntegrationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIntegrations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLogAnomalyDetectorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLogAnomalyDetectors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLogGroupsForQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLogGroupsForQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsLogGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsLogGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAccountPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAccountPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutDataProtectionPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutDataProtectionPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutDeliveryDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutDeliveryDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutDeliveryDestinationPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutDeliveryDestinationPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutDeliverySourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutDeliverySource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutDestinationPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutDestinationPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutIndexPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutIndexPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutLogEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutLogEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutMetricFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutMetricFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutQueryDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutQueryDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRetentionPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRetentionPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutSubscriptionFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutSubscriptionFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutTransformerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutTransformer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartLiveTailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartLiveTail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagLogGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagLogGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestMetricFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestMetricFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestTransformerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestTransformer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagLogGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagLogGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAnomalySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAnomaly(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDeliveryConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDeliveryConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLogAnomalyDetectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLogAnomalyDetector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/codeartifact/generated.json b/service/codeartifact/generated.json index a778fa0f370..60336464966 100644 --- a/service/codeartifact/generated.json +++ b/service/codeartifact/generated.json @@ -69,6 +69,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/codeartifact/sra_operation_order_test.go b/service/codeartifact/sra_operation_order_test.go new file mode 100644 index 00000000000..02081a24606 --- /dev/null +++ b/service/codeartifact/sra_operation_order_test.go @@ -0,0 +1,1701 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codeartifact + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateExternalConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateExternalConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCopyPackageVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopyPackageVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePackageGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePackageGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRepositorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRepository(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDomainPermissionsPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDomainPermissionsPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePackageGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePackageGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePackageVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePackageVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRepositorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRepository(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRepositoryPermissionsPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRepositoryPermissionsPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePackageGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePackageGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePackageVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePackageVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRepositorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRepository(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateExternalConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateExternalConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisposePackageVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisposePackageVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAssociatedPackageGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAssociatedPackageGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAuthorizationTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAuthorizationToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDomainPermissionsPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDomainPermissionsPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPackageVersionAssetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPackageVersionAsset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPackageVersionReadmeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPackageVersionReadme(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRepositoryEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRepositoryEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRepositoryPermissionsPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRepositoryPermissionsPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAllowedRepositoriesForGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAllowedRepositoriesForGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssociatedPackagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssociatedPackages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDomainsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDomains(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPackageGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPackageGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPackagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPackages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPackageVersionAssetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPackageVersionAssets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPackageVersionDependenciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPackageVersionDependencies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPackageVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPackageVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRepositoriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRepositories(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRepositoriesInDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRepositoriesInDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSubPackageGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSubPackageGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPublishPackageVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PublishPackageVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutDomainPermissionsPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutDomainPermissionsPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutPackageOriginConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutPackageOriginConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRepositoryPermissionsPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRepositoryPermissionsPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePackageGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePackageGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePackageGroupOriginConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePackageGroupOriginConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePackageVersionsStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePackageVersionsStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRepositorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRepository(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/codebuild/generated.json b/service/codebuild/generated.json index bce3615ef7b..b3f4ff88cc8 100644 --- a/service/codebuild/generated.json +++ b/service/codebuild/generated.json @@ -71,6 +71,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/codebuild/sra_operation_order_test.go b/service/codebuild/sra_operation_order_test.go new file mode 100644 index 00000000000..0f12b5e9fde --- /dev/null +++ b/service/codebuild/sra_operation_order_test.go @@ -0,0 +1,1771 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codebuild + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchDeleteBuildsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteBuilds(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetBuildBatchesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetBuildBatches(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetBuildsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetBuilds(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetFleetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetFleets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetProjectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetProjects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetReportGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetReportGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetReportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetReports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateReportGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateReportGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWebhookSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWebhook(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBuildBatchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBuildBatch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteReportGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteReportGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSourceCredentialsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSourceCredentials(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWebhookSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWebhook(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCodeCoveragesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCodeCoverages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTestCasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTestCases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReportGroupTrendSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReportGroupTrend(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportSourceCredentialsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportSourceCredentials(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInvalidateProjectCacheSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InvalidateProjectCache(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBuildBatchesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBuildBatches(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBuildBatchesForProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBuildBatchesForProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBuildsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBuilds(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBuildsForProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBuildsForProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCuratedEnvironmentImagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCuratedEnvironmentImages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFleetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFleets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProjectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProjects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReportGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReportGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReportsForReportGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReportsForReportGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSharedProjectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSharedProjects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSharedReportGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSharedReportGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSourceCredentialsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSourceCredentials(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRetryBuildSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RetryBuild(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRetryBuildBatchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RetryBuildBatch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartBuildSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartBuild(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartBuildBatchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartBuildBatch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopBuildSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopBuild(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopBuildBatchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopBuildBatch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProjectVisibilitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProjectVisibility(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateReportGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateReportGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWebhookSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWebhook(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/codecatalyst/generated.json b/service/codecatalyst/generated.json index c9f3d6f6720..9a5e9ed3ac3 100644 --- a/service/codecatalyst/generated.json +++ b/service/codecatalyst/generated.json @@ -59,6 +59,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/codecatalyst/sra_operation_order_test.go b/service/codecatalyst/sra_operation_order_test.go new file mode 100644 index 00000000000..94ec6e8d7ee --- /dev/null +++ b/service/codecatalyst/sra_operation_order_test.go @@ -0,0 +1,1351 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateAccessTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAccessToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDevEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDevEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSourceRepositorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSourceRepository(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSourceRepositoryBranchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSourceRepositoryBranch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccessTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccessToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDevEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDevEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSourceRepositorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSourceRepository(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSpaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSpace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDevEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDevEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSourceRepositorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSourceRepository(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSourceRepositoryCloneUrlsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSourceRepositoryCloneUrls(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSpaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSpace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUserDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUserDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWorkflowRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWorkflowRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccessTokensSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccessTokens(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDevEnvironmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDevEnvironments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDevEnvironmentSessionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDevEnvironmentSessions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEventLogsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEventLogs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProjectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProjects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSourceRepositoriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSourceRepositories(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSourceRepositoryBranchesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSourceRepositoryBranches(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSpacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSpaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkflowRunsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkflowRuns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkflowsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkflows(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDevEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDevEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDevEnvironmentSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDevEnvironmentSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartWorkflowRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartWorkflowRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopDevEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopDevEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopDevEnvironmentSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopDevEnvironmentSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDevEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDevEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSpaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSpace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpVerifySessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.VerifySession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/codecommit/generated.json b/service/codecommit/generated.json index c611300e428..6cb932b038b 100644 --- a/service/codecommit/generated.json +++ b/service/codecommit/generated.json @@ -100,6 +100,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/codecommit/sra_operation_order_test.go b/service/codecommit/sra_operation_order_test.go new file mode 100644 index 00000000000..f25a78704c7 --- /dev/null +++ b/service/codecommit/sra_operation_order_test.go @@ -0,0 +1,2786 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecommit + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateApprovalRuleTemplateWithRepositorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateApprovalRuleTemplateWithRepository(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchAssociateApprovalRuleTemplateWithRepositoriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchAssociateApprovalRuleTemplateWithRepositories(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDescribeMergeConflictsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDescribeMergeConflicts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDisassociateApprovalRuleTemplateFromRepositoriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDisassociateApprovalRuleTemplateFromRepositories(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetCommitsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetCommits(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetRepositoriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetRepositories(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateApprovalRuleTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApprovalRuleTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBranchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBranch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCommitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCommit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePullRequestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePullRequest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePullRequestApprovalRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePullRequestApprovalRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRepositorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRepository(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUnreferencedMergeCommitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUnreferencedMergeCommit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApprovalRuleTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApprovalRuleTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBranchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBranch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCommentContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCommentContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePullRequestApprovalRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePullRequestApprovalRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRepositorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRepository(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMergeConflictsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMergeConflicts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePullRequestEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePullRequestEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateApprovalRuleTemplateFromRepositorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateApprovalRuleTemplateFromRepository(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEvaluatePullRequestApprovalRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EvaluatePullRequestApprovalRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApprovalRuleTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApprovalRuleTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBlobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBlob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBranchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBranch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCommentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetComment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCommentReactionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCommentReactions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCommentsForComparedCommitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCommentsForComparedCommit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCommentsForPullRequestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCommentsForPullRequest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCommitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCommit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDifferencesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDifferences(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFolderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFolder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMergeCommitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMergeCommit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMergeConflictsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMergeConflicts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMergeOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMergeOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPullRequestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPullRequest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPullRequestApprovalStatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPullRequestApprovalStates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPullRequestOverrideStateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPullRequestOverrideState(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRepositorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRepository(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRepositoryTriggersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRepositoryTriggers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApprovalRuleTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApprovalRuleTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssociatedApprovalRuleTemplatesForRepositorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssociatedApprovalRuleTemplatesForRepository(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBranchesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBranches(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFileCommitHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFileCommitHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPullRequestsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPullRequests(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRepositoriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRepositories(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRepositoriesForApprovalRuleTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRepositoriesForApprovalRuleTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMergeBranchesByFastForwardSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MergeBranchesByFastForward(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMergeBranchesBySquashSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MergeBranchesBySquash(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMergeBranchesByThreeWaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MergeBranchesByThreeWay(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMergePullRequestByFastForwardSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MergePullRequestByFastForward(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMergePullRequestBySquashSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MergePullRequestBySquash(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMergePullRequestByThreeWaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MergePullRequestByThreeWay(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpOverridePullRequestApprovalRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.OverridePullRequestApprovalRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPostCommentForComparedCommitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PostCommentForComparedCommit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPostCommentForPullRequestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PostCommentForPullRequest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPostCommentReplySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PostCommentReply(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutCommentReactionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutCommentReaction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutFileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutFile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRepositoryTriggersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRepositoryTriggers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestRepositoryTriggersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestRepositoryTriggers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApprovalRuleTemplateContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApprovalRuleTemplateContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApprovalRuleTemplateDescriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApprovalRuleTemplateDescription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApprovalRuleTemplateNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApprovalRuleTemplateName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCommentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateComment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDefaultBranchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDefaultBranch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePullRequestApprovalRuleContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePullRequestApprovalRuleContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePullRequestApprovalStateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePullRequestApprovalState(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePullRequestDescriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePullRequestDescription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePullRequestStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePullRequestStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePullRequestTitleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePullRequestTitle(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRepositoryDescriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRepositoryDescription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRepositoryEncryptionKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRepositoryEncryptionKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRepositoryNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRepositoryName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/codeconnections/generated.json b/service/codeconnections/generated.json index 631187be308..cfd366ca8e8 100644 --- a/service/codeconnections/generated.json +++ b/service/codeconnections/generated.json @@ -48,6 +48,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/codeconnections/sra_operation_order_test.go b/service/codeconnections/sra_operation_order_test.go new file mode 100644 index 00000000000..532b07e97f5 --- /dev/null +++ b/service/codeconnections/sra_operation_order_test.go @@ -0,0 +1,966 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codeconnections + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateHostSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateHost(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRepositoryLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRepositoryLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSyncConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSyncConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteHostSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteHost(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRepositoryLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRepositoryLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSyncConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSyncConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetHostSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetHost(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRepositoryLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRepositoryLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRepositorySyncStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRepositorySyncStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourceSyncStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourceSyncStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSyncBlockerSummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSyncBlockerSummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSyncConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSyncConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConnectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConnections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListHostsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListHosts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRepositoryLinksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRepositoryLinks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRepositorySyncDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRepositorySyncDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSyncConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSyncConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateHostSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateHost(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRepositoryLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRepositoryLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSyncBlockerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSyncBlocker(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSyncConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSyncConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/codedeploy/generated.json b/service/codedeploy/generated.json index eefea96e0f1..b59d051e1f2 100644 --- a/service/codedeploy/generated.json +++ b/service/codedeploy/generated.json @@ -68,6 +68,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/codedeploy/sra_operation_order_test.go b/service/codedeploy/sra_operation_order_test.go new file mode 100644 index 00000000000..836f0bc1c03 --- /dev/null +++ b/service/codedeploy/sra_operation_order_test.go @@ -0,0 +1,1666 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codedeploy + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddTagsToOnPremisesInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddTagsToOnPremisesInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetApplicationRevisionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetApplicationRevisions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetDeploymentGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetDeploymentGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetDeploymentInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetDeploymentInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetDeploymentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetDeployments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetDeploymentTargetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetDeploymentTargets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetOnPremisesInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetOnPremisesInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpContinueDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ContinueDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDeploymentConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDeploymentConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDeploymentGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDeploymentGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDeploymentConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDeploymentConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDeploymentGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDeploymentGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGitHubAccountTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGitHubAccountToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourcesByExternalIdSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourcesByExternalId(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterOnPremisesInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterOnPremisesInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApplicationRevisionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApplicationRevision(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeploymentConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeploymentConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeploymentGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeploymentGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeploymentInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeploymentInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeploymentTargetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeploymentTarget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOnPremisesInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOnPremisesInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationRevisionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplicationRevisions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDeploymentConfigsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDeploymentConfigs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDeploymentGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDeploymentGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDeploymentInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDeploymentInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDeploymentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDeployments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDeploymentTargetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDeploymentTargets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGitHubAccountTokenNamesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGitHubAccountTokenNames(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOnPremisesInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOnPremisesInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutLifecycleEventHookExecutionStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutLifecycleEventHookExecutionStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterApplicationRevisionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterApplicationRevision(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterOnPremisesInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterOnPremisesInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveTagsFromOnPremisesInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveTagsFromOnPremisesInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSkipWaitTimeForInstanceTerminationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SkipWaitTimeForInstanceTermination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDeploymentGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDeploymentGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/codeguruprofiler/generated.json b/service/codeguruprofiler/generated.json index cb2097896d5..17a9a047fce 100644 --- a/service/codeguruprofiler/generated.json +++ b/service/codeguruprofiler/generated.json @@ -44,6 +44,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/codeguruprofiler/sra_operation_order_test.go b/service/codeguruprofiler/sra_operation_order_test.go new file mode 100644 index 00000000000..392e8ed2cde --- /dev/null +++ b/service/codeguruprofiler/sra_operation_order_test.go @@ -0,0 +1,826 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codeguruprofiler + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddNotificationChannelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddNotificationChannels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetFrameMetricDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetFrameMetricData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpConfigureAgentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ConfigureAgent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProfilingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProfilingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProfilingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProfilingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeProfilingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeProfilingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFindingsReportAccountSummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFindingsReportAccountSummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetNotificationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetNotificationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFindingsReportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFindingsReports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProfileTimesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProfileTimes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProfilingGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProfilingGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPostAgentProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PostAgentProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutPermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutPermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveNotificationChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveNotificationChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemovePermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemovePermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSubmitFeedbackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SubmitFeedback(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProfilingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProfilingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/codegurureviewer/generated.json b/service/codegurureviewer/generated.json index c603b8a611c..cf36d83e8fb 100644 --- a/service/codegurureviewer/generated.json +++ b/service/codegurureviewer/generated.json @@ -35,6 +35,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/codegurureviewer/sra_operation_order_test.go b/service/codegurureviewer/sra_operation_order_test.go new file mode 100644 index 00000000000..45ccb29cf39 --- /dev/null +++ b/service/codegurureviewer/sra_operation_order_test.go @@ -0,0 +1,511 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codegurureviewer + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateRepositorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateRepository(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCodeReviewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCodeReview(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCodeReviewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCodeReview(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRecommendationFeedbackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRecommendationFeedback(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRepositoryAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRepositoryAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateRepositorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateRepository(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCodeReviewsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCodeReviews(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRecommendationFeedbackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRecommendationFeedback(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRepositoryAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRepositoryAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRecommendationFeedbackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRecommendationFeedback(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/codegurusecurity/generated.json b/service/codegurusecurity/generated.json index 30a225484ed..a6184c6835b 100644 --- a/service/codegurusecurity/generated.json +++ b/service/codegurusecurity/generated.json @@ -34,6 +34,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/codegurusecurity/sra_operation_order_test.go b/service/codegurusecurity/sra_operation_order_test.go new file mode 100644 index 00000000000..c0e4019c106 --- /dev/null +++ b/service/codegurusecurity/sra_operation_order_test.go @@ -0,0 +1,476 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codegurusecurity + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchGetFindingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetFindings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateScanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateScan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUploadUrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUploadUrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccountConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccountConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFindingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFindings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMetricsSummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMetricsSummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetScanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetScan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFindingsMetricsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFindingsMetrics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListScansSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListScans(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAccountConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAccountConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/codepipeline/generated.json b/service/codepipeline/generated.json index 8440c002b5c..34bee3645a9 100644 --- a/service/codepipeline/generated.json +++ b/service/codepipeline/generated.json @@ -64,6 +64,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/codepipeline/sra_operation_order_test.go b/service/codepipeline/sra_operation_order_test.go new file mode 100644 index 00000000000..c13702524c8 --- /dev/null +++ b/service/codepipeline/sra_operation_order_test.go @@ -0,0 +1,1526 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codepipeline + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcknowledgeJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcknowledgeJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAcknowledgeThirdPartyJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcknowledgeThirdPartyJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCustomActionTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCustomActionType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCustomActionTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCustomActionType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWebhookSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWebhook(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterWebhookWithThirdPartySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterWebhookWithThirdParty(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableStageTransitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableStageTransition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableStageTransitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableStageTransition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetActionTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetActionType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetJobDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetJobDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPipelineExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPipelineExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPipelineStateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPipelineState(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetThirdPartyJobDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetThirdPartyJobDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListActionExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListActionExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListActionTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListActionTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPipelineExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPipelineExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPipelinesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPipelines(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRuleExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRuleExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRuleTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRuleTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWebhooksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWebhooks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpOverrideStageConditionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.OverrideStageCondition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPollForJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PollForJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPollForThirdPartyJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PollForThirdPartyJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutActionRevisionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutActionRevision(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutApprovalResultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutApprovalResult(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutJobFailureResultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutJobFailureResult(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutJobSuccessResultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutJobSuccessResult(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutThirdPartyJobFailureResultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutThirdPartyJobFailureResult(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutThirdPartyJobSuccessResultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutThirdPartyJobSuccessResult(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutWebhookSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutWebhook(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterWebhookWithThirdPartySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterWebhookWithThirdParty(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRetryStageExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RetryStageExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRollbackStageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RollbackStage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartPipelineExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartPipelineExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopPipelineExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopPipelineExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateActionTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateActionType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/codestarconnections/generated.json b/service/codestarconnections/generated.json index e2755780101..89e8b32a16a 100644 --- a/service/codestarconnections/generated.json +++ b/service/codestarconnections/generated.json @@ -48,6 +48,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/codestarconnections/sra_operation_order_test.go b/service/codestarconnections/sra_operation_order_test.go new file mode 100644 index 00000000000..010f9db4a06 --- /dev/null +++ b/service/codestarconnections/sra_operation_order_test.go @@ -0,0 +1,966 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codestarconnections + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateHostSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateHost(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRepositoryLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRepositoryLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSyncConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSyncConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteHostSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteHost(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRepositoryLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRepositoryLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSyncConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSyncConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetHostSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetHost(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRepositoryLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRepositoryLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRepositorySyncStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRepositorySyncStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourceSyncStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourceSyncStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSyncBlockerSummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSyncBlockerSummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSyncConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSyncConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConnectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConnections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListHostsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListHosts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRepositoryLinksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRepositoryLinks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRepositorySyncDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRepositorySyncDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSyncConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSyncConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateHostSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateHost(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRepositoryLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRepositoryLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSyncBlockerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSyncBlocker(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSyncConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSyncConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/codestarnotifications/generated.json b/service/codestarnotifications/generated.json index 2b5ca2c4a03..f1b698f01e7 100644 --- a/service/codestarnotifications/generated.json +++ b/service/codestarnotifications/generated.json @@ -34,6 +34,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/codestarnotifications/sra_operation_order_test.go b/service/codestarnotifications/sra_operation_order_test.go new file mode 100644 index 00000000000..af9a43f6790 --- /dev/null +++ b/service/codestarnotifications/sra_operation_order_test.go @@ -0,0 +1,476 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codestarnotifications + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateNotificationRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNotificationRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNotificationRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNotificationRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTargetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTarget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeNotificationRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeNotificationRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEventTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEventTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNotificationRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNotificationRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTargetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTargets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSubscribeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Subscribe(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUnsubscribeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Unsubscribe(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateNotificationRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateNotificationRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/cognitoidentity/generated.json b/service/cognitoidentity/generated.json index 7754a2f98f8..a6f0d950bfc 100644 --- a/service/cognitoidentity/generated.json +++ b/service/cognitoidentity/generated.json @@ -44,6 +44,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/cognitoidentity/sra_operation_order_test.go b/service/cognitoidentity/sra_operation_order_test.go new file mode 100644 index 00000000000..359489ff0ce --- /dev/null +++ b/service/cognitoidentity/sra_operation_order_test.go @@ -0,0 +1,826 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cognitoidentity + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateIdentityPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIdentityPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIdentitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIdentities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIdentityPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIdentityPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIdentitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIdentity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIdentityPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIdentityPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCredentialsForIdentitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCredentialsForIdentity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIdSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetId(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIdentityPoolRolesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIdentityPoolRoles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOpenIdTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOpenIdToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOpenIdTokenForDeveloperIdentitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOpenIdTokenForDeveloperIdentity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPrincipalTagAttributeMapSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPrincipalTagAttributeMap(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIdentitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIdentities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIdentityPoolsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIdentityPools(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpLookupDeveloperIdentitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.LookupDeveloperIdentity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMergeDeveloperIdentitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MergeDeveloperIdentities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetIdentityPoolRolesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetIdentityPoolRoles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetPrincipalTagAttributeMapSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetPrincipalTagAttributeMap(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUnlinkDeveloperIdentitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UnlinkDeveloperIdentity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUnlinkIdentitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UnlinkIdentity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIdentityPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIdentityPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/cognitoidentityprovider/generated.json b/service/cognitoidentityprovider/generated.json index 41891d10d0f..cb896a6eb8d 100644 --- a/service/cognitoidentityprovider/generated.json +++ b/service/cognitoidentityprovider/generated.json @@ -138,6 +138,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/cognitoidentityprovider/sra_operation_order_test.go b/service/cognitoidentityprovider/sra_operation_order_test.go new file mode 100644 index 00000000000..56110d7fa47 --- /dev/null +++ b/service/cognitoidentityprovider/sra_operation_order_test.go @@ -0,0 +1,3976 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cognitoidentityprovider + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddCustomAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddCustomAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAdminAddUserToGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AdminAddUserToGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAdminConfirmSignUpSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AdminConfirmSignUp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAdminCreateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AdminCreateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAdminDeleteUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AdminDeleteUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAdminDeleteUserAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AdminDeleteUserAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAdminDisableProviderForUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AdminDisableProviderForUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAdminDisableUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AdminDisableUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAdminEnableUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AdminEnableUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAdminForgetDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AdminForgetDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAdminGetDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AdminGetDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAdminGetUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AdminGetUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAdminInitiateAuthSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AdminInitiateAuth(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAdminLinkProviderForUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AdminLinkProviderForUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAdminListDevicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AdminListDevices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAdminListGroupsForUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AdminListGroupsForUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAdminListUserAuthEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AdminListUserAuthEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAdminRemoveUserFromGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AdminRemoveUserFromGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAdminResetUserPasswordSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AdminResetUserPassword(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAdminRespondToAuthChallengeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AdminRespondToAuthChallenge(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAdminSetUserMFAPreferenceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AdminSetUserMFAPreference(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAdminSetUserPasswordSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AdminSetUserPassword(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAdminSetUserSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AdminSetUserSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAdminUpdateAuthEventFeedbackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AdminUpdateAuthEventFeedback(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAdminUpdateDeviceStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AdminUpdateDeviceStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAdminUpdateUserAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AdminUpdateUserAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAdminUserGlobalSignOutSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AdminUserGlobalSignOut(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateSoftwareTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateSoftwareToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpChangePasswordSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ChangePassword(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCompleteWebAuthnRegistrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CompleteWebAuthnRegistration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpConfirmDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ConfirmDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpConfirmForgotPasswordSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ConfirmForgotPassword(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpConfirmSignUpSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ConfirmSignUp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIdentityProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIdentityProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateManagedLoginBrandingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateManagedLoginBranding(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateResourceServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateResourceServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUserImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUserImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUserPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUserPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUserPoolClientSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUserPoolClient(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUserPoolDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUserPoolDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIdentityProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIdentityProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteManagedLoginBrandingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteManagedLoginBranding(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourceServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourceServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUserAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUserPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserPoolClientSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUserPoolClient(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserPoolDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUserPoolDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWebAuthnCredentialSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWebAuthnCredential(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIdentityProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIdentityProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeManagedLoginBrandingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeManagedLoginBranding(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeManagedLoginBrandingByClientSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeManagedLoginBrandingByClient(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeResourceServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeResourceServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRiskConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRiskConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeUserImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeUserImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeUserPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeUserPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeUserPoolClientSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeUserPoolClient(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeUserPoolDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeUserPoolDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpForgetDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ForgetDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpForgotPasswordSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ForgotPassword(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCSVHeaderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCSVHeader(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIdentityProviderByIdentifierSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIdentityProviderByIdentifier(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLogDeliveryConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLogDeliveryConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSigningCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSigningCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUICustomizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUICustomization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUserAttributeVerificationCodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUserAttributeVerificationCode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUserAuthFactorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUserAuthFactors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUserPoolMfaConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUserPoolMfaConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGlobalSignOutSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GlobalSignOut(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInitiateAuthSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InitiateAuth(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDevicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDevices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIdentityProvidersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIdentityProviders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceServersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceServers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUserImportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUserImportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUserPoolClientsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUserPoolClients(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUserPoolsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUserPools(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUsersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUsers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUsersInGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUsersInGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWebAuthnCredentialsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWebAuthnCredentials(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResendConfirmationCodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResendConfirmationCode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRespondToAuthChallengeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RespondToAuthChallenge(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRevokeTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RevokeToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetLogDeliveryConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetLogDeliveryConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetRiskConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetRiskConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetUICustomizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetUICustomization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetUserMFAPreferenceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetUserMFAPreference(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetUserPoolMfaConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetUserPoolMfaConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetUserSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetUserSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSignUpSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SignUp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartUserImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartUserImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartWebAuthnRegistrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartWebAuthnRegistration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopUserImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopUserImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAuthEventFeedbackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAuthEventFeedback(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDeviceStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDeviceStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIdentityProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIdentityProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateManagedLoginBrandingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateManagedLoginBranding(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateResourceServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateResourceServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUserAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUserPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserPoolClientSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUserPoolClient(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserPoolDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUserPoolDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpVerifySoftwareTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.VerifySoftwareToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpVerifyUserAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.VerifyUserAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/cognitosync/generated.json b/service/cognitosync/generated.json index d77d46adc3b..5732b46cdc0 100644 --- a/service/cognitosync/generated.json +++ b/service/cognitosync/generated.json @@ -38,6 +38,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/cognitosync/sra_operation_order_test.go b/service/cognitosync/sra_operation_order_test.go new file mode 100644 index 00000000000..435fb06fcab --- /dev/null +++ b/service/cognitosync/sra_operation_order_test.go @@ -0,0 +1,616 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cognitosync + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBulkPublishSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BulkPublish(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIdentityPoolUsageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIdentityPoolUsage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIdentityUsageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIdentityUsage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBulkPublishDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBulkPublishDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCognitoEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCognitoEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIdentityPoolConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIdentityPoolConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDatasetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDatasets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIdentityPoolUsageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIdentityPoolUsage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRecordsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRecords(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetCognitoEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetCognitoEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetIdentityPoolConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetIdentityPoolConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSubscribeToDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SubscribeToDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUnsubscribeFromDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UnsubscribeFromDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRecordsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRecords(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/comprehend/generated.json b/service/comprehend/generated.json index 60b8ab93f64..9f81207bf73 100644 --- a/service/comprehend/generated.json +++ b/service/comprehend/generated.json @@ -106,6 +106,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/comprehend/sra_operation_order_test.go b/service/comprehend/sra_operation_order_test.go new file mode 100644 index 00000000000..81e5f5257df --- /dev/null +++ b/service/comprehend/sra_operation_order_test.go @@ -0,0 +1,2996 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package comprehend + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchDetectDominantLanguageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDetectDominantLanguage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDetectEntitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDetectEntities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDetectKeyPhrasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDetectKeyPhrases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDetectSentimentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDetectSentiment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDetectSyntaxSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDetectSyntax(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDetectTargetedSentimentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDetectTargetedSentiment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpClassifyDocumentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ClassifyDocument(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpContainsPiiEntitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ContainsPiiEntities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDocumentClassifierSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDocumentClassifier(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEntityRecognizerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEntityRecognizer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFlywheelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFlywheel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDocumentClassifierSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDocumentClassifier(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEntityRecognizerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEntityRecognizer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFlywheelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFlywheel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDocumentClassificationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDocumentClassificationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDocumentClassifierSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDocumentClassifier(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDominantLanguageDetectionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDominantLanguageDetectionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEntitiesDetectionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEntitiesDetectionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEntityRecognizerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEntityRecognizer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventsDetectionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEventsDetectionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFlywheelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFlywheel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFlywheelIterationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFlywheelIteration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeKeyPhrasesDetectionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeKeyPhrasesDetectionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePiiEntitiesDetectionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePiiEntitiesDetectionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSentimentDetectionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSentimentDetectionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTargetedSentimentDetectionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTargetedSentimentDetectionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTopicsDetectionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTopicsDetectionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetectDominantLanguageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetectDominantLanguage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetectEntitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetectEntities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetectKeyPhrasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetectKeyPhrases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetectPiiEntitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetectPiiEntities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetectSentimentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetectSentiment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetectSyntaxSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetectSyntax(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetectTargetedSentimentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetectTargetedSentiment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetectToxicContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetectToxicContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDatasetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDatasets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDocumentClassificationJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDocumentClassificationJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDocumentClassifiersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDocumentClassifiers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDocumentClassifierSummariesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDocumentClassifierSummaries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDominantLanguageDetectionJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDominantLanguageDetectionJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEntitiesDetectionJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEntitiesDetectionJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEntityRecognizersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEntityRecognizers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEntityRecognizerSummariesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEntityRecognizerSummaries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEventsDetectionJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEventsDetectionJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFlywheelIterationHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFlywheelIterationHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFlywheelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFlywheels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListKeyPhrasesDetectionJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListKeyPhrasesDetectionJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPiiEntitiesDetectionJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPiiEntitiesDetectionJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSentimentDetectionJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSentimentDetectionJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTargetedSentimentDetectionJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTargetedSentimentDetectionJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTopicsDetectionJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTopicsDetectionJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDocumentClassificationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDocumentClassificationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDominantLanguageDetectionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDominantLanguageDetectionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartEntitiesDetectionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartEntitiesDetectionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartEventsDetectionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartEventsDetectionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartFlywheelIterationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartFlywheelIteration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartKeyPhrasesDetectionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartKeyPhrasesDetectionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartPiiEntitiesDetectionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartPiiEntitiesDetectionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartSentimentDetectionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartSentimentDetectionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartTargetedSentimentDetectionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartTargetedSentimentDetectionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartTopicsDetectionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartTopicsDetectionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopDominantLanguageDetectionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopDominantLanguageDetectionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopEntitiesDetectionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopEntitiesDetectionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopEventsDetectionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopEventsDetectionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopKeyPhrasesDetectionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopKeyPhrasesDetectionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopPiiEntitiesDetectionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopPiiEntitiesDetectionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopSentimentDetectionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopSentimentDetectionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopTargetedSentimentDetectionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopTargetedSentimentDetectionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopTrainingDocumentClassifierSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopTrainingDocumentClassifier(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopTrainingEntityRecognizerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopTrainingEntityRecognizer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFlywheelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFlywheel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/comprehendmedical/generated.json b/service/comprehendmedical/generated.json index 7b2888080ad..1d9b7480a1d 100644 --- a/service/comprehendmedical/generated.json +++ b/service/comprehendmedical/generated.json @@ -47,6 +47,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/comprehendmedical/sra_operation_order_test.go b/service/comprehendmedical/sra_operation_order_test.go new file mode 100644 index 00000000000..a9fe7581c5f --- /dev/null +++ b/service/comprehendmedical/sra_operation_order_test.go @@ -0,0 +1,931 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package comprehendmedical + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpDescribeEntitiesDetectionV2JobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEntitiesDetectionV2Job(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeICD10CMInferenceJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeICD10CMInferenceJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePHIDetectionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePHIDetectionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRxNormInferenceJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRxNormInferenceJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSNOMEDCTInferenceJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSNOMEDCTInferenceJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetectEntitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetectEntities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetectEntitiesV2SRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetectEntitiesV2(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetectPHISRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetectPHI(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInferICD10CMSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InferICD10CM(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInferRxNormSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InferRxNorm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInferSNOMEDCTSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InferSNOMEDCT(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEntitiesDetectionV2JobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEntitiesDetectionV2Jobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListICD10CMInferenceJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListICD10CMInferenceJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPHIDetectionJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPHIDetectionJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRxNormInferenceJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRxNormInferenceJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSNOMEDCTInferenceJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSNOMEDCTInferenceJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartEntitiesDetectionV2JobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartEntitiesDetectionV2Job(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartICD10CMInferenceJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartICD10CMInferenceJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartPHIDetectionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartPHIDetectionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartRxNormInferenceJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartRxNormInferenceJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartSNOMEDCTInferenceJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartSNOMEDCTInferenceJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopEntitiesDetectionV2JobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopEntitiesDetectionV2Job(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopICD10CMInferenceJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopICD10CMInferenceJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopPHIDetectionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopPHIDetectionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopRxNormInferenceJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopRxNormInferenceJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopSNOMEDCTInferenceJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopSNOMEDCTInferenceJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/computeoptimizer/generated.json b/service/computeoptimizer/generated.json index df7e6dbbce2..d55f065f0fa 100644 --- a/service/computeoptimizer/generated.json +++ b/service/computeoptimizer/generated.json @@ -49,6 +49,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/computeoptimizer/sra_operation_order_test.go b/service/computeoptimizer/sra_operation_order_test.go new file mode 100644 index 00000000000..e0a607b397f --- /dev/null +++ b/service/computeoptimizer/sra_operation_order_test.go @@ -0,0 +1,1001 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package computeoptimizer + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpDeleteRecommendationPreferencesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRecommendationPreferences(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRecommendationExportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRecommendationExportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportAutoScalingGroupRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportAutoScalingGroupRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportEBSVolumeRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportEBSVolumeRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportEC2InstanceRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportEC2InstanceRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportECSServiceRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportECSServiceRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportIdleRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportIdleRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportLambdaFunctionRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportLambdaFunctionRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportLicenseRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportLicenseRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportRDSDatabaseRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportRDSDatabaseRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAutoScalingGroupRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAutoScalingGroupRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEBSVolumeRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEBSVolumeRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEC2InstanceRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEC2InstanceRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEC2RecommendationProjectedMetricsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEC2RecommendationProjectedMetrics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetECSServiceRecommendationProjectedMetricsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetECSServiceRecommendationProjectedMetrics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetECSServiceRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetECSServiceRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEffectiveRecommendationPreferencesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEffectiveRecommendationPreferences(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEnrollmentStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEnrollmentStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEnrollmentStatusesForOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEnrollmentStatusesForOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIdleRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIdleRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLambdaFunctionRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLambdaFunctionRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLicenseRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLicenseRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRDSDatabaseRecommendationProjectedMetricsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRDSDatabaseRecommendationProjectedMetrics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRDSDatabaseRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRDSDatabaseRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRecommendationPreferencesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRecommendationPreferences(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRecommendationSummariesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRecommendationSummaries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRecommendationPreferencesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRecommendationPreferences(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEnrollmentStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEnrollmentStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/configservice/generated.json b/service/configservice/generated.json index 84272a63521..10fc96a953e 100644 --- a/service/configservice/generated.json +++ b/service/configservice/generated.json @@ -118,6 +118,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/configservice/sra_operation_order_test.go b/service/configservice/sra_operation_order_test.go new file mode 100644 index 00000000000..1528dbd423f --- /dev/null +++ b/service/configservice/sra_operation_order_test.go @@ -0,0 +1,3416 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package configservice + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateResourceTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateResourceTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetAggregateResourceConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetAggregateResourceConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetResourceConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetResourceConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAggregationAuthorizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAggregationAuthorization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConfigRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConfigRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConfigurationAggregatorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConfigurationAggregator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConfigurationRecorderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConfigurationRecorder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConformancePackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConformancePack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDeliveryChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDeliveryChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEvaluationResultsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEvaluationResults(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteOrganizationConfigRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteOrganizationConfigRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteOrganizationConformancePackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteOrganizationConformancePack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePendingAggregationRequestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePendingAggregationRequest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRemediationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRemediationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRemediationExceptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRemediationExceptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourceConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourceConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRetentionConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRetentionConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteServiceLinkedConfigurationRecorderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteServiceLinkedConfigurationRecorder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteStoredQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteStoredQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeliverConfigSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeliverConfigSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAggregateComplianceByConfigRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAggregateComplianceByConfigRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAggregateComplianceByConformancePacksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAggregateComplianceByConformancePacks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAggregationAuthorizationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAggregationAuthorizations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeComplianceByConfigRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeComplianceByConfigRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeComplianceByResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeComplianceByResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConfigRuleEvaluationStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConfigRuleEvaluationStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConfigRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConfigRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConfigurationAggregatorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConfigurationAggregators(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConfigurationAggregatorSourcesStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConfigurationAggregatorSourcesStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConfigurationRecordersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConfigurationRecorders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConfigurationRecorderStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConfigurationRecorderStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConformancePackComplianceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConformancePackCompliance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConformancePacksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConformancePacks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConformancePackStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConformancePackStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDeliveryChannelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDeliveryChannels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDeliveryChannelStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDeliveryChannelStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOrganizationConfigRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOrganizationConfigRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOrganizationConfigRuleStatusesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOrganizationConfigRuleStatuses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOrganizationConformancePacksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOrganizationConformancePacks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOrganizationConformancePackStatusesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOrganizationConformancePackStatuses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePendingAggregationRequestsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePendingAggregationRequests(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRemediationConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRemediationConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRemediationExceptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRemediationExceptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRemediationExecutionStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRemediationExecutionStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRetentionConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRetentionConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateResourceTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateResourceTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAggregateComplianceDetailsByConfigRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAggregateComplianceDetailsByConfigRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAggregateConfigRuleComplianceSummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAggregateConfigRuleComplianceSummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAggregateConformancePackComplianceSummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAggregateConformancePackComplianceSummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAggregateDiscoveredResourceCountsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAggregateDiscoveredResourceCounts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAggregateResourceConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAggregateResourceConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetComplianceDetailsByConfigRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetComplianceDetailsByConfigRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetComplianceDetailsByResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetComplianceDetailsByResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetComplianceSummaryByConfigRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetComplianceSummaryByConfigRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetComplianceSummaryByResourceTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetComplianceSummaryByResourceType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConformancePackComplianceDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConformancePackComplianceDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConformancePackComplianceSummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConformancePackComplianceSummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCustomRulePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCustomRulePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDiscoveredResourceCountsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDiscoveredResourceCounts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOrganizationConfigRuleDetailedStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOrganizationConfigRuleDetailedStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOrganizationConformancePackDetailedStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOrganizationConformancePackDetailedStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOrganizationCustomRulePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOrganizationCustomRulePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourceConfigHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourceConfigHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourceEvaluationSummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourceEvaluationSummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStoredQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStoredQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAggregateDiscoveredResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAggregateDiscoveredResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConfigurationRecordersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConfigurationRecorders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConformancePackComplianceScoresSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConformancePackComplianceScores(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDiscoveredResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDiscoveredResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceEvaluationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceEvaluations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStoredQueriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStoredQueries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAggregationAuthorizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAggregationAuthorization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutConfigRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutConfigRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutConfigurationAggregatorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutConfigurationAggregator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutConfigurationRecorderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutConfigurationRecorder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutConformancePackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutConformancePack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutDeliveryChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutDeliveryChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutEvaluationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutEvaluations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutExternalEvaluationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutExternalEvaluation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutOrganizationConfigRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutOrganizationConfigRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutOrganizationConformancePackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutOrganizationConformancePack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRemediationConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRemediationConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRemediationExceptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRemediationExceptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResourceConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResourceConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRetentionConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRetentionConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutServiceLinkedConfigurationRecorderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutServiceLinkedConfigurationRecorder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutStoredQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutStoredQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSelectAggregateResourceConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SelectAggregateResourceConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSelectResourceConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SelectResourceConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartConfigRulesEvaluationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartConfigRulesEvaluation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartConfigurationRecorderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartConfigurationRecorder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartRemediationExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartRemediationExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartResourceEvaluationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartResourceEvaluation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopConfigurationRecorderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopConfigurationRecorder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/connect/generated.json b/service/connect/generated.json index aab5d36ad04..eed191d9a99 100644 --- a/service/connect/generated.json +++ b/service/connect/generated.json @@ -303,6 +303,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/connect/sra_operation_order_test.go b/service/connect/sra_operation_order_test.go new file mode 100644 index 00000000000..75d0cd179d0 --- /dev/null +++ b/service/connect/sra_operation_order_test.go @@ -0,0 +1,9891 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connect + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpActivateEvaluationFormSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ActivateEvaluationForm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateAnalyticsDataSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateAnalyticsDataSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateApprovedOriginSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateApprovedOrigin(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateBotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateBot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateDefaultVocabularySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateDefaultVocabulary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateInstanceStorageConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateInstanceStorageConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateLambdaFunctionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateLambdaFunction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateLexBotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateLexBot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociatePhoneNumberContactFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociatePhoneNumberContactFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateQueueQuickConnectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateQueueQuickConnects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateRoutingProfileQueuesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateRoutingProfileQueues(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateSecurityKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateSecurityKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateTrafficDistributionGroupUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateTrafficDistributionGroupUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateUserProficienciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateUserProficiencies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchAssociateAnalyticsDataSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchAssociateAnalyticsDataSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDisassociateAnalyticsDataSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDisassociateAnalyticsDataSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetAttachedFileMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetAttachedFileMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetFlowAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetFlowAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchPutContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchPutContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpClaimPhoneNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ClaimPhoneNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCompleteAttachedFileUploadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CompleteAttachedFileUpload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAgentStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAgentStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateContactFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateContactFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateContactFlowModuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateContactFlowModule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateContactFlowVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateContactFlowVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEmailAddressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEmailAddress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEvaluationFormSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEvaluationForm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateHoursOfOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateHoursOfOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateHoursOfOperationOverrideSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateHoursOfOperationOverride(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIntegrationAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIntegrationAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateParticipantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateParticipant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePersistentContactAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePersistentContactAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePredefinedAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePredefinedAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePromptSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePrompt(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePushNotificationRegistrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePushNotificationRegistration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateQuickConnectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateQuickConnect(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRoutingProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRoutingProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSecurityProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSecurityProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTaskTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTaskTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTrafficDistributionGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTrafficDistributionGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUseCaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUseCase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUserHierarchyGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUserHierarchyGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateViewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateView(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateViewVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateViewVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVocabularySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVocabulary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeactivateEvaluationFormSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeactivateEvaluationForm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAttachedFileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAttachedFile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteContactEvaluationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteContactEvaluation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteContactFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteContactFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteContactFlowModuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteContactFlowModule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteContactFlowVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteContactFlowVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEmailAddressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEmailAddress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEvaluationFormSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEvaluationForm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteHoursOfOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteHoursOfOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteHoursOfOperationOverrideSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteHoursOfOperationOverride(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIntegrationAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIntegrationAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePredefinedAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePredefinedAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePromptSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePrompt(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePushNotificationRegistrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePushNotificationRegistration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteQuickConnectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteQuickConnect(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRoutingProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRoutingProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSecurityProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSecurityProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTaskTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTaskTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTrafficDistributionGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTrafficDistributionGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUseCaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUseCase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserHierarchyGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUserHierarchyGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteViewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteView(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteViewVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteViewVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVocabularySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVocabulary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAgentStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAgentStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAuthenticationProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAuthenticationProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeContactEvaluationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeContactEvaluation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeContactFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeContactFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeContactFlowModuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeContactFlowModule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEmailAddressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEmailAddress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEvaluationFormSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEvaluationForm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeHoursOfOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeHoursOfOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeHoursOfOperationOverrideSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeHoursOfOperationOverride(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInstanceAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInstanceAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInstanceStorageConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInstanceStorageConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePhoneNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePhoneNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePredefinedAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePredefinedAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePromptSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePrompt(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeQuickConnectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeQuickConnect(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRoutingProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRoutingProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSecurityProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSecurityProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTrafficDistributionGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTrafficDistributionGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeUserHierarchyGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeUserHierarchyGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeUserHierarchyStructureSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeUserHierarchyStructure(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeViewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeView(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVocabularySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVocabulary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateAnalyticsDataSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateAnalyticsDataSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateApprovedOriginSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateApprovedOrigin(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateBotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateBot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateInstanceStorageConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateInstanceStorageConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateLambdaFunctionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateLambdaFunction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateLexBotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateLexBot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociatePhoneNumberContactFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociatePhoneNumberContactFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateQueueQuickConnectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateQueueQuickConnects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateRoutingProfileQueuesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateRoutingProfileQueues(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateSecurityKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateSecurityKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateTrafficDistributionGroupUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateTrafficDistributionGroupUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateUserProficienciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateUserProficiencies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDismissUserContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DismissUserContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAttachedFileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAttachedFile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetContactAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetContactAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCurrentMetricDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCurrentMetricData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCurrentUserDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCurrentUserData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEffectiveHoursOfOperationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEffectiveHoursOfOperations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFederationTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFederationToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFlowAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFlowAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMetricDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMetricData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMetricDataV2SRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMetricDataV2(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPromptFileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPromptFile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTaskTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTaskTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTrafficDistributionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTrafficDistribution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportPhoneNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportPhoneNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAgentStatusesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAgentStatuses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAnalyticsDataAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAnalyticsDataAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAnalyticsDataLakeDataSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAnalyticsDataLakeDataSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApprovedOriginsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApprovedOrigins(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssociatedContactsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssociatedContacts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAuthenticationProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAuthenticationProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListContactEvaluationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListContactEvaluations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListContactFlowModulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListContactFlowModules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListContactFlowsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListContactFlows(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListContactFlowVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListContactFlowVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListContactReferencesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListContactReferences(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDefaultVocabulariesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDefaultVocabularies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEvaluationFormsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEvaluationForms(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEvaluationFormVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEvaluationFormVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFlowAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFlowAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListHoursOfOperationOverridesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListHoursOfOperationOverrides(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListHoursOfOperationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListHoursOfOperations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInstanceAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInstanceAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInstanceStorageConfigsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInstanceStorageConfigs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIntegrationAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIntegrationAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLambdaFunctionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLambdaFunctions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLexBotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLexBots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPhoneNumbersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPhoneNumbers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPhoneNumbersV2SRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPhoneNumbersV2(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPredefinedAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPredefinedAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPromptsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPrompts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListQueueQuickConnectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListQueueQuickConnects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListQueuesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListQueues(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListQuickConnectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListQuickConnects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRealtimeContactAnalysisSegmentsV2SRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRealtimeContactAnalysisSegmentsV2(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRoutingProfileQueuesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRoutingProfileQueues(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRoutingProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRoutingProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSecurityKeysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSecurityKeys(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSecurityProfileApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSecurityProfileApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSecurityProfilePermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSecurityProfilePermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSecurityProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSecurityProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTaskTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTaskTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTrafficDistributionGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTrafficDistributionGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTrafficDistributionGroupUsersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTrafficDistributionGroupUsers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUseCasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUseCases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUserHierarchyGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUserHierarchyGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUserProficienciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUserProficiencies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUsersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUsers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListViewsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListViews(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListViewVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListViewVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMonitorContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MonitorContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPauseContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PauseContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutUserStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutUserStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReleasePhoneNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReleasePhoneNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReplicateInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReplicateInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResumeContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResumeContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResumeContactRecordingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResumeContactRecording(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchAgentStatusesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchAgentStatuses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchAvailablePhoneNumbersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchAvailablePhoneNumbers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchContactFlowModulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchContactFlowModules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchContactFlowsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchContactFlows(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchContactsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchContacts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchEmailAddressesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchEmailAddresses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchHoursOfOperationOverridesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchHoursOfOperationOverrides(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchHoursOfOperationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchHoursOfOperations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchPredefinedAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchPredefinedAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchPromptsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchPrompts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchQueuesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchQueues(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchQuickConnectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchQuickConnects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchResourceTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchResourceTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchRoutingProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchRoutingProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchSecurityProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchSecurityProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchUserHierarchyGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchUserHierarchyGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchUsersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchUsers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchVocabulariesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchVocabularies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendChatIntegrationEventSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendChatIntegrationEvent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendOutboundEmailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendOutboundEmail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartAttachedFileUploadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartAttachedFileUpload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartChatContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartChatContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartContactEvaluationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartContactEvaluation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartContactRecordingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartContactRecording(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartContactStreamingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartContactStreaming(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartEmailContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartEmailContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartOutboundChatContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartOutboundChatContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartOutboundEmailContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartOutboundEmailContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartOutboundVoiceContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartOutboundVoiceContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartScreenSharingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartScreenSharing(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartTaskContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartTaskContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartWebRTCContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartWebRTCContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopContactRecordingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopContactRecording(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopContactStreamingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopContactStreaming(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSubmitContactEvaluationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SubmitContactEvaluation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSuspendContactRecordingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SuspendContactRecording(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTransferContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TransferContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAgentStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAgentStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAuthenticationProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAuthenticationProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateContactAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateContactAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateContactEvaluationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateContactEvaluation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateContactFlowContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateContactFlowContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateContactFlowMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateContactFlowMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateContactFlowModuleContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateContactFlowModuleContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateContactFlowModuleMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateContactFlowModuleMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateContactFlowNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateContactFlowName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateContactRoutingDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateContactRoutingData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateContactScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateContactSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEmailAddressMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEmailAddressMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEvaluationFormSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEvaluationForm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateHoursOfOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateHoursOfOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateHoursOfOperationOverrideSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateHoursOfOperationOverride(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateInstanceAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateInstanceAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateInstanceStorageConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateInstanceStorageConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateParticipantAuthenticationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateParticipantAuthentication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateParticipantRoleConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateParticipantRoleConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePhoneNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePhoneNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePhoneNumberMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePhoneNumberMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePredefinedAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePredefinedAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePromptSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePrompt(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateQueueHoursOfOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateQueueHoursOfOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateQueueMaxContactsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateQueueMaxContacts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateQueueNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateQueueName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateQueueOutboundCallerConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateQueueOutboundCallerConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateQueueOutboundEmailConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateQueueOutboundEmailConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateQueueStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateQueueStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateQuickConnectConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateQuickConnectConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateQuickConnectNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateQuickConnectName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRoutingProfileAgentAvailabilityTimerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRoutingProfileAgentAvailabilityTimer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRoutingProfileConcurrencySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRoutingProfileConcurrency(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRoutingProfileDefaultOutboundQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRoutingProfileDefaultOutboundQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRoutingProfileNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRoutingProfileName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRoutingProfileQueuesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRoutingProfileQueues(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSecurityProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSecurityProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTaskTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTaskTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTrafficDistributionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTrafficDistribution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserHierarchySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUserHierarchy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserHierarchyGroupNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUserHierarchyGroupName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserHierarchyStructureSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUserHierarchyStructure(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserIdentityInfoSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUserIdentityInfo(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserPhoneConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUserPhoneConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserProficienciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUserProficiencies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserRoutingProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUserRoutingProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserSecurityProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUserSecurityProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateViewContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateViewContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateViewMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateViewMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/connectcampaigns/generated.json b/service/connectcampaigns/generated.json index 6e8403bd10c..cb9858dbd48 100644 --- a/service/connectcampaigns/generated.json +++ b/service/connectcampaigns/generated.json @@ -43,6 +43,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/connectcampaigns/sra_operation_order_test.go b/service/connectcampaigns/sra_operation_order_test.go new file mode 100644 index 00000000000..936f332e0de --- /dev/null +++ b/service/connectcampaigns/sra_operation_order_test.go @@ -0,0 +1,791 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaigns + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateCampaignSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCampaign(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCampaignSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCampaign(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConnectInstanceConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConnectInstanceConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInstanceOnboardingJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInstanceOnboardingJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCampaignSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCampaign(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCampaignStateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCampaignState(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCampaignStateBatchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCampaignStateBatch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConnectInstanceConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConnectInstanceConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInstanceOnboardingJobStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInstanceOnboardingJobStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCampaignsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCampaigns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPauseCampaignSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PauseCampaign(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutDialRequestBatchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutDialRequestBatch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResumeCampaignSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResumeCampaign(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartCampaignSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartCampaign(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartInstanceOnboardingJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartInstanceOnboardingJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopCampaignSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopCampaign(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCampaignDialerConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCampaignDialerConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCampaignNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCampaignName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCampaignOutboundCallConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCampaignOutboundCallConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/connectcampaignsv2/generated.json b/service/connectcampaignsv2/generated.json index a290a6f3cdb..02a7d5a4c11 100644 --- a/service/connectcampaignsv2/generated.json +++ b/service/connectcampaignsv2/generated.json @@ -54,6 +54,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/connectcampaignsv2/sra_operation_order_test.go b/service/connectcampaignsv2/sra_operation_order_test.go new file mode 100644 index 00000000000..ce6c7d0239a --- /dev/null +++ b/service/connectcampaignsv2/sra_operation_order_test.go @@ -0,0 +1,1176 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcampaignsv2 + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateCampaignSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCampaign(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCampaignSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCampaign(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCampaignChannelSubtypeConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCampaignChannelSubtypeConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCampaignCommunicationLimitsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCampaignCommunicationLimits(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCampaignCommunicationTimeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCampaignCommunicationTime(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConnectInstanceConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConnectInstanceConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConnectInstanceIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConnectInstanceIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInstanceOnboardingJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInstanceOnboardingJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCampaignSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCampaign(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCampaignStateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCampaignState(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCampaignStateBatchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCampaignStateBatch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConnectInstanceConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConnectInstanceConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInstanceOnboardingJobStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInstanceOnboardingJobStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCampaignsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCampaigns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConnectInstanceIntegrationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConnectInstanceIntegrations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPauseCampaignSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PauseCampaign(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutConnectInstanceIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutConnectInstanceIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutOutboundRequestBatchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutOutboundRequestBatch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutProfileOutboundRequestBatchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutProfileOutboundRequestBatch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResumeCampaignSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResumeCampaign(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartCampaignSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartCampaign(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartInstanceOnboardingJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartInstanceOnboardingJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopCampaignSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopCampaign(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCampaignChannelSubtypeConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCampaignChannelSubtypeConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCampaignCommunicationLimitsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCampaignCommunicationLimits(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCampaignCommunicationTimeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCampaignCommunicationTime(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCampaignFlowAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCampaignFlowAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCampaignNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCampaignName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCampaignScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCampaignSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCampaignSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCampaignSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/connectcases/generated.json b/service/connectcases/generated.json index 34f6c6924ba..19e756c189f 100644 --- a/service/connectcases/generated.json +++ b/service/connectcases/generated.json @@ -60,6 +60,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/connectcases/sra_operation_order_test.go b/service/connectcases/sra_operation_order_test.go new file mode 100644 index 00000000000..d50b3da40d6 --- /dev/null +++ b/service/connectcases/sra_operation_order_test.go @@ -0,0 +1,1386 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcases + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchGetCaseRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetCaseRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetFieldSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetField(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchPutFieldOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchPutFieldOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCaseRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCaseRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFieldSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateField(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLayoutSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLayout(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRelatedItemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRelatedItem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCaseRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCaseRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFieldSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteField(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLayoutSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLayout(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCaseAuditEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCaseAuditEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCaseEventConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCaseEventConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLayoutSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLayout(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCaseRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCaseRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCasesForContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCasesForContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDomainsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDomains(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFieldOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFieldOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFieldsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFields(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLayoutsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLayouts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutCaseEventConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutCaseEventConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchCasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchCases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchRelatedItemsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchRelatedItems(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCaseRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCaseRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFieldSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateField(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLayoutSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLayout(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/connectcontactlens/generated.json b/service/connectcontactlens/generated.json index 42df1c2fb7b..d6fbc74632c 100644 --- a/service/connectcontactlens/generated.json +++ b/service/connectcontactlens/generated.json @@ -22,6 +22,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/connectcontactlens/sra_operation_order_test.go b/service/connectcontactlens/sra_operation_order_test.go new file mode 100644 index 00000000000..2bb2807b53c --- /dev/null +++ b/service/connectcontactlens/sra_operation_order_test.go @@ -0,0 +1,56 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectcontactlens + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpListRealtimeContactAnalysisSegmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRealtimeContactAnalysisSegments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/connectparticipant/generated.json b/service/connectparticipant/generated.json index 084ca90a0b8..f5513b95f8e 100644 --- a/service/connectparticipant/generated.json +++ b/service/connectparticipant/generated.json @@ -32,6 +32,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/connectparticipant/sra_operation_order_test.go b/service/connectparticipant/sra_operation_order_test.go new file mode 100644 index 00000000000..26bcce42bfa --- /dev/null +++ b/service/connectparticipant/sra_operation_order_test.go @@ -0,0 +1,406 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectparticipant + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCancelParticipantAuthenticationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelParticipantAuthentication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCompleteAttachmentUploadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CompleteAttachmentUpload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateParticipantConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateParticipantConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeViewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeView(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisconnectParticipantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisconnectParticipant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAuthenticationUrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAuthenticationUrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTranscriptSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTranscript(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendEventSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendEvent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendMessageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendMessage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartAttachmentUploadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartAttachmentUpload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/controlcatalog/generated.json b/service/controlcatalog/generated.json index e40c67f6b29..c58c7352094 100644 --- a/service/controlcatalog/generated.json +++ b/service/controlcatalog/generated.json @@ -26,6 +26,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/controlcatalog/sra_operation_order_test.go b/service/controlcatalog/sra_operation_order_test.go new file mode 100644 index 00000000000..c9499b559cd --- /dev/null +++ b/service/controlcatalog/sra_operation_order_test.go @@ -0,0 +1,196 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package controlcatalog + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpGetControlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetControl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCommonControlsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCommonControls(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListControlsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListControls(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDomainsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDomains(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListObjectivesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListObjectives(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/controltower/generated.json b/service/controltower/generated.json index 6c2d1aab4f3..cda9e7587cf 100644 --- a/service/controltower/generated.json +++ b/service/controltower/generated.json @@ -53,6 +53,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/controltower/sra_operation_order_test.go b/service/controltower/sra_operation_order_test.go new file mode 100644 index 00000000000..2c2455a90e8 --- /dev/null +++ b/service/controltower/sra_operation_order_test.go @@ -0,0 +1,1001 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package controltower + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateLandingZoneSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLandingZone(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLandingZoneSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLandingZone(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableBaselineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableBaseline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableControlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableControl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableBaselineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableBaseline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableControlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableControl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBaselineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBaseline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBaselineOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBaselineOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetControlOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetControlOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEnabledBaselineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEnabledBaseline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEnabledControlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEnabledControl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLandingZoneSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLandingZone(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLandingZoneOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLandingZoneOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBaselinesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBaselines(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListControlOperationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListControlOperations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEnabledBaselinesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEnabledBaselines(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEnabledControlsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEnabledControls(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLandingZoneOperationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLandingZoneOperations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLandingZonesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLandingZones(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetEnabledBaselineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetEnabledBaseline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetEnabledControlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetEnabledControl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetLandingZoneSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetLandingZone(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEnabledBaselineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEnabledBaseline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEnabledControlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEnabledControl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLandingZoneSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLandingZone(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/costandusagereportservice/generated.json b/service/costandusagereportservice/generated.json index bf0c599fe32..95a5689bd47 100644 --- a/service/costandusagereportservice/generated.json +++ b/service/costandusagereportservice/generated.json @@ -28,6 +28,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/costandusagereportservice/sra_operation_order_test.go b/service/costandusagereportservice/sra_operation_order_test.go new file mode 100644 index 00000000000..ca424120900 --- /dev/null +++ b/service/costandusagereportservice/sra_operation_order_test.go @@ -0,0 +1,266 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costandusagereportservice + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpDeleteReportDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteReportDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReportDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReportDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyReportDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyReportDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutReportDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutReportDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/costexplorer/generated.json b/service/costexplorer/generated.json index 3ce0ac9a1be..18ce5e7bfff 100644 --- a/service/costexplorer/generated.json +++ b/service/costexplorer/generated.json @@ -65,6 +65,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/costexplorer/sra_operation_order_test.go b/service/costexplorer/sra_operation_order_test.go new file mode 100644 index 00000000000..ee185ac0538 --- /dev/null +++ b/service/costexplorer/sra_operation_order_test.go @@ -0,0 +1,1561 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costexplorer + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateAnomalyMonitorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAnomalyMonitor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAnomalySubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAnomalySubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCostCategoryDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCostCategoryDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAnomalyMonitorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAnomalyMonitor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAnomalySubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAnomalySubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCostCategoryDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCostCategoryDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCostCategoryDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCostCategoryDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAnomaliesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAnomalies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAnomalyMonitorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAnomalyMonitors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAnomalySubscriptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAnomalySubscriptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApproximateUsageRecordsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApproximateUsageRecords(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCommitmentPurchaseAnalysisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCommitmentPurchaseAnalysis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCostAndUsageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCostAndUsage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCostAndUsageWithResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCostAndUsageWithResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCostCategoriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCostCategories(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCostForecastSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCostForecast(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDimensionValuesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDimensionValues(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReservationCoverageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReservationCoverage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReservationPurchaseRecommendationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReservationPurchaseRecommendation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReservationUtilizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReservationUtilization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRightsizingRecommendationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRightsizingRecommendation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSavingsPlanPurchaseRecommendationDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSavingsPlanPurchaseRecommendationDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSavingsPlansCoverageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSavingsPlansCoverage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSavingsPlansPurchaseRecommendationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSavingsPlansPurchaseRecommendation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSavingsPlansUtilizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSavingsPlansUtilization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSavingsPlansUtilizationDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSavingsPlansUtilizationDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUsageForecastSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUsageForecast(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCommitmentPurchaseAnalysesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCommitmentPurchaseAnalyses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCostAllocationTagBackfillHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCostAllocationTagBackfillHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCostAllocationTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCostAllocationTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCostCategoryDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCostCategoryDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSavingsPlansPurchaseRecommendationGenerationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSavingsPlansPurchaseRecommendationGeneration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpProvideAnomalyFeedbackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ProvideAnomalyFeedback(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartCommitmentPurchaseAnalysisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartCommitmentPurchaseAnalysis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartCostAllocationTagBackfillSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartCostAllocationTagBackfill(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartSavingsPlansPurchaseRecommendationGenerationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartSavingsPlansPurchaseRecommendationGeneration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAnomalyMonitorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAnomalyMonitor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAnomalySubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAnomalySubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCostAllocationTagsStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCostAllocationTagsStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCostCategoryDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCostCategoryDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/costoptimizationhub/generated.json b/service/costoptimizationhub/generated.json index 2c3512f349e..18c9aa8503f 100644 --- a/service/costoptimizationhub/generated.json +++ b/service/costoptimizationhub/generated.json @@ -28,6 +28,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/costoptimizationhub/sra_operation_order_test.go b/service/costoptimizationhub/sra_operation_order_test.go new file mode 100644 index 00000000000..55e50b84ae0 --- /dev/null +++ b/service/costoptimizationhub/sra_operation_order_test.go @@ -0,0 +1,266 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costoptimizationhub + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpGetPreferencesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPreferences(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRecommendationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRecommendation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEnrollmentStatusesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEnrollmentStatuses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRecommendationSummariesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRecommendationSummaries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEnrollmentStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEnrollmentStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePreferencesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePreferences(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/customerprofiles/generated.json b/service/customerprofiles/generated.json index 56d2d02b073..c039728a06d 100644 --- a/service/customerprofiles/generated.json +++ b/service/customerprofiles/generated.json @@ -91,6 +91,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/customerprofiles/sra_operation_order_test.go b/service/customerprofiles/sra_operation_order_test.go new file mode 100644 index 00000000000..5f9f40826fa --- /dev/null +++ b/service/customerprofiles/sra_operation_order_test.go @@ -0,0 +1,2471 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddProfileKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddProfileKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetCalculatedAttributeForProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetCalculatedAttributeForProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCalculatedAttributeDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCalculatedAttributeDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEventStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEventStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEventTriggerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEventTrigger(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIntegrationWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIntegrationWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSegmentDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSegmentDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSegmentEstimateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSegmentEstimate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSegmentSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSegmentSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCalculatedAttributeDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCalculatedAttributeDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEventStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEventStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEventTriggerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEventTrigger(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProfileKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProfileKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProfileObjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProfileObject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProfileObjectTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProfileObjectType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSegmentDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSegmentDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetectProfileObjectTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetectProfileObjectType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAutoMergingPreviewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAutoMergingPreview(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCalculatedAttributeDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCalculatedAttributeDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCalculatedAttributeForProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCalculatedAttributeForProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEventStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEventStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEventTriggerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEventTrigger(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIdentityResolutionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIdentityResolutionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMatchesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMatches(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetProfileObjectTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetProfileObjectType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetProfileObjectTypeTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetProfileObjectTypeTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSegmentDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSegmentDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSegmentEstimateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSegmentEstimate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSegmentMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSegmentMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSegmentSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSegmentSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSimilarProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSimilarProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWorkflowStepsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWorkflowSteps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccountIntegrationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccountIntegrations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCalculatedAttributeDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCalculatedAttributeDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCalculatedAttributesForProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCalculatedAttributesForProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDomainsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDomains(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEventStreamsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEventStreams(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEventTriggersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEventTriggers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIdentityResolutionJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIdentityResolutionJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIntegrationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIntegrations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListObjectTypeAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListObjectTypeAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProfileAttributeValuesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProfileAttributeValues(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProfileObjectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProfileObjects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProfileObjectTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProfileObjectTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProfileObjectTypeTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProfileObjectTypeTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRuleBasedMatchesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRuleBasedMatches(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSegmentDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSegmentDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkflowsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkflows(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMergeProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MergeProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutProfileObjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutProfileObject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutProfileObjectTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutProfileObjectType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCalculatedAttributeDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCalculatedAttributeDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEventTriggerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEventTrigger(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/databasemigrationservice/generated.json b/service/databasemigrationservice/generated.json index 9e0039a4a00..c99324f9edc 100644 --- a/service/databasemigrationservice/generated.json +++ b/service/databasemigrationservice/generated.json @@ -133,6 +133,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/databasemigrationservice/sra_operation_order_test.go b/service/databasemigrationservice/sra_operation_order_test.go new file mode 100644 index 00000000000..f73f197cdd5 --- /dev/null +++ b/service/databasemigrationservice/sra_operation_order_test.go @@ -0,0 +1,3941 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package databasemigrationservice + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddTagsToResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddTagsToResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpApplyPendingMaintenanceActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ApplyPendingMaintenanceAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchStartRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchStartRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelReplicationTaskAssessmentRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelReplicationTaskAssessmentRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataMigrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataMigration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEventSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEventSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFleetAdvisorCollectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFleetAdvisorCollector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInstanceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInstanceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMigrationProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMigrationProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateReplicationConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateReplicationConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateReplicationInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateReplicationInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateReplicationSubnetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateReplicationSubnetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateReplicationTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateReplicationTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataMigrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataMigration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEventSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEventSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFleetAdvisorCollectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFleetAdvisorCollector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFleetAdvisorDatabasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFleetAdvisorDatabases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInstanceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInstanceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMigrationProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMigrationProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteReplicationConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteReplicationConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteReplicationInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteReplicationInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteReplicationSubnetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteReplicationSubnetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteReplicationTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteReplicationTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteReplicationTaskAssessmentRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteReplicationTaskAssessmentRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccountAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccountAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeApplicableIndividualAssessmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeApplicableIndividualAssessments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCertificatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCertificates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConnectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConnections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConversionConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConversionConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDataMigrationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDataMigrations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDataProvidersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDataProviders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEndpointSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEndpointSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEndpointTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEndpointTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEngineVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEngineVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventCategoriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEventCategories(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventSubscriptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEventSubscriptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeExtensionPackAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeExtensionPackAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFleetAdvisorCollectorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFleetAdvisorCollectors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFleetAdvisorDatabasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFleetAdvisorDatabases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFleetAdvisorLsaAnalysisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFleetAdvisorLsaAnalysis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFleetAdvisorSchemaObjectSummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFleetAdvisorSchemaObjectSummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFleetAdvisorSchemasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFleetAdvisorSchemas(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInstanceProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInstanceProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMetadataModelAssessmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMetadataModelAssessments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMetadataModelConversionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMetadataModelConversions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMetadataModelExportsAsScriptSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMetadataModelExportsAsScript(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMetadataModelExportsToTargetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMetadataModelExportsToTarget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMetadataModelImportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMetadataModelImports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMigrationProjectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMigrationProjects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOrderableReplicationInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOrderableReplicationInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePendingMaintenanceActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePendingMaintenanceActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRecommendationLimitationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRecommendationLimitations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRefreshSchemasStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRefreshSchemasStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReplicationConfigsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReplicationConfigs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReplicationInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReplicationInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReplicationInstanceTaskLogsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReplicationInstanceTaskLogs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReplicationSubnetGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReplicationSubnetGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReplicationTableStatisticsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReplicationTableStatistics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReplicationTaskAssessmentResultsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReplicationTaskAssessmentResults(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReplicationTaskAssessmentRunsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReplicationTaskAssessmentRuns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReplicationTaskIndividualAssessmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReplicationTaskIndividualAssessments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReplicationTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReplicationTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSchemasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSchemas(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTableStatisticsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTableStatistics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportMetadataModelAssessmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportMetadataModelAssessment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyConversionConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyConversionConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDataMigrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDataMigration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDataProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDataProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyEventSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyEventSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyInstanceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyInstanceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyMigrationProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyMigrationProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyReplicationConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyReplicationConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyReplicationInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyReplicationInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyReplicationSubnetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyReplicationSubnetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyReplicationTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyReplicationTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMoveReplicationTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MoveReplicationTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRebootReplicationInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RebootReplicationInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRefreshSchemasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RefreshSchemas(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReloadReplicationTablesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReloadReplicationTables(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReloadTablesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReloadTables(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveTagsFromResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveTagsFromResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRunFleetAdvisorLsaAnalysisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RunFleetAdvisorLsaAnalysis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDataMigrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDataMigration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartExtensionPackAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartExtensionPackAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMetadataModelAssessmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMetadataModelAssessment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMetadataModelConversionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMetadataModelConversion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMetadataModelExportAsScriptSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMetadataModelExportAsScript(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMetadataModelExportToTargetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMetadataModelExportToTarget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMetadataModelImportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMetadataModelImport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartReplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartReplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartReplicationTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartReplicationTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartReplicationTaskAssessmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartReplicationTaskAssessment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartReplicationTaskAssessmentRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartReplicationTaskAssessmentRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopDataMigrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopDataMigration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopReplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopReplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopReplicationTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopReplicationTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSubscriptionsToEventBridgeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSubscriptionsToEventBridge(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/databrew/generated.json b/service/databrew/generated.json index db15c598ec9..a6c49a286d9 100644 --- a/service/databrew/generated.json +++ b/service/databrew/generated.json @@ -65,6 +65,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/databrew/sra_operation_order_test.go b/service/databrew/sra_operation_order_test.go new file mode 100644 index 00000000000..b6e57666dc6 --- /dev/null +++ b/service/databrew/sra_operation_order_test.go @@ -0,0 +1,1561 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package databrew + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchDeleteRecipeVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteRecipeVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProfileJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProfileJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRecipeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRecipe(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRecipeJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRecipeJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRulesetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRuleset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRecipeVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRecipeVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRulesetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRuleset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeJobRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeJobRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRecipeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRecipe(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRulesetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRuleset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDatasetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDatasets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJobRunsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJobRuns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProjectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProjects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRecipesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRecipes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRecipeVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRecipeVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRulesetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRulesets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSchedulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSchedules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPublishRecipeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PublishRecipe(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendProjectSessionActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendProjectSessionAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartJobRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartJobRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartProjectSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartProjectSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopJobRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopJobRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProfileJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProfileJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRecipeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRecipe(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRecipeJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRecipeJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRulesetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRuleset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/dataexchange/generated.json b/service/dataexchange/generated.json index 218330fb151..1d82a6454d7 100644 --- a/service/dataexchange/generated.json +++ b/service/dataexchange/generated.json @@ -58,6 +58,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/dataexchange/sra_operation_order_test.go b/service/dataexchange/sra_operation_order_test.go new file mode 100644 index 00000000000..ae70149c489 --- /dev/null +++ b/service/dataexchange/sra_operation_order_test.go @@ -0,0 +1,1316 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package dataexchange + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcceptDataGrantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptDataGrant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataGrantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataGrant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEventActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEventAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRevisionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRevision(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAssetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAsset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataGrantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataGrant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEventActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEventAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRevisionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRevision(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAssetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAsset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataGrantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataGrant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEventActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEventAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReceivedDataGrantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReceivedDataGrant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRevisionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRevision(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataGrantsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataGrants(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataSetRevisionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataSetRevisions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEventActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEventActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReceivedDataGrantsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReceivedDataGrants(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRevisionAssetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRevisionAssets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRevokeRevisionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RevokeRevision(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendApiAssetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendApiAsset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendDataSetNotificationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendDataSetNotification(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAssetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAsset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDataSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEventActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEventAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRevisionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRevision(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/datapipeline/generated.json b/service/datapipeline/generated.json index 53f58462acb..20688d742f4 100644 --- a/service/datapipeline/generated.json +++ b/service/datapipeline/generated.json @@ -40,6 +40,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/datapipeline/sra_operation_order_test.go b/service/datapipeline/sra_operation_order_test.go new file mode 100644 index 00000000000..34b8429f11b --- /dev/null +++ b/service/datapipeline/sra_operation_order_test.go @@ -0,0 +1,686 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package datapipeline + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpActivatePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ActivatePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeactivatePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeactivatePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeObjectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeObjects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePipelinesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePipelines(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEvaluateExpressionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EvaluateExpression(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPipelineDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPipelineDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPipelinesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPipelines(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPollForTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PollForTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutPipelineDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutPipelineDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpQueryObjectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.QueryObjects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReportTaskProgressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReportTaskProgress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReportTaskRunnerHeartbeatSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReportTaskRunnerHeartbeat(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetTaskStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetTaskStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpValidatePipelineDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ValidatePipelineDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/datasync/generated.json b/service/datasync/generated.json index 4f23f16b8d7..5637d80c010 100644 --- a/service/datasync/generated.json +++ b/service/datasync/generated.json @@ -87,6 +87,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/datasync/sra_operation_order_test.go b/service/datasync/sra_operation_order_test.go new file mode 100644 index 00000000000..e07116be72f --- /dev/null +++ b/service/datasync/sra_operation_order_test.go @@ -0,0 +1,2331 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package datasync + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddStorageSystemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddStorageSystem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelTaskExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelTaskExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAgentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAgent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLocationAzureBlobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLocationAzureBlob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLocationEfsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLocationEfs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLocationFsxLustreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLocationFsxLustre(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLocationFsxOntapSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLocationFsxOntap(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLocationFsxOpenZfsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLocationFsxOpenZfs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLocationFsxWindowsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLocationFsxWindows(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLocationHdfsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLocationHdfs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLocationNfsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLocationNfs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLocationObjectStorageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLocationObjectStorage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLocationS3SRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLocationS3(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLocationSmbSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLocationSmb(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAgentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAgent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLocationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLocation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAgentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAgent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDiscoveryJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDiscoveryJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLocationAzureBlobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLocationAzureBlob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLocationEfsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLocationEfs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLocationFsxLustreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLocationFsxLustre(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLocationFsxOntapSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLocationFsxOntap(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLocationFsxOpenZfsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLocationFsxOpenZfs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLocationFsxWindowsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLocationFsxWindows(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLocationHdfsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLocationHdfs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLocationNfsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLocationNfs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLocationObjectStorageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLocationObjectStorage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLocationS3SRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLocationS3(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLocationSmbSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLocationSmb(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStorageSystemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStorageSystem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStorageSystemResourceMetricsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStorageSystemResourceMetrics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStorageSystemResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStorageSystemResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTaskExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTaskExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGenerateRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GenerateRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAgentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAgents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDiscoveryJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDiscoveryJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLocationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLocations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStorageSystemsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStorageSystems(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTaskExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTaskExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveStorageSystemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveStorageSystem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDiscoveryJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDiscoveryJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartTaskExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartTaskExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopDiscoveryJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopDiscoveryJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAgentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAgent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDiscoveryJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDiscoveryJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLocationAzureBlobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLocationAzureBlob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLocationEfsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLocationEfs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLocationFsxLustreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLocationFsxLustre(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLocationFsxOntapSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLocationFsxOntap(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLocationFsxOpenZfsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLocationFsxOpenZfs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLocationFsxWindowsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLocationFsxWindows(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLocationHdfsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLocationHdfs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLocationNfsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLocationNfs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLocationObjectStorageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLocationObjectStorage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLocationS3SRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLocationS3(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLocationSmbSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLocationSmb(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateStorageSystemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateStorageSystem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTaskExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTaskExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/datazone/generated.json b/service/datazone/generated.json index a1c4961a92a..f82e97e0337 100644 --- a/service/datazone/generated.json +++ b/service/datazone/generated.json @@ -179,6 +179,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/datazone/sra_operation_order_test.go b/service/datazone/sra_operation_order_test.go new file mode 100644 index 00000000000..4f576af90a4 --- /dev/null +++ b/service/datazone/sra_operation_order_test.go @@ -0,0 +1,5551 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package datazone + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcceptPredictionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptPredictions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAcceptSubscriptionRequestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptSubscriptionRequest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddEntityOwnerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddEntityOwner(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddPolicyGrantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddPolicyGrant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateEnvironmentRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateEnvironmentRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelMetadataGenerationRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelMetadataGenerationRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAssetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAsset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAssetFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAssetFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAssetRevisionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAssetRevision(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAssetTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAssetType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataProductSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataProduct(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataProductRevisionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataProductRevision(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDomainUnitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDomainUnit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEnvironmentActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEnvironmentAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEnvironmentProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEnvironmentProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFormTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFormType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGlossarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGlossary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGlossaryTermSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGlossaryTerm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGroupProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGroupProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateListingChangeSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateListingChangeSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProjectMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProjectMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProjectProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProjectProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSubscriptionGrantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSubscriptionGrant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSubscriptionRequestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSubscriptionRequest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSubscriptionTargetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSubscriptionTarget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUserProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUserProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAssetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAsset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAssetFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAssetFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAssetTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAssetType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataProductSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataProduct(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDomainUnitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDomainUnit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEnvironmentActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEnvironmentAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEnvironmentBlueprintConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEnvironmentBlueprintConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEnvironmentProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEnvironmentProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFormTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFormType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGlossarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGlossary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGlossaryTermSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGlossaryTerm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteListingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteListing(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProjectMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProjectMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProjectProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProjectProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSubscriptionGrantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSubscriptionGrant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSubscriptionRequestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSubscriptionRequest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSubscriptionTargetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSubscriptionTarget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTimeSeriesDataPointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTimeSeriesDataPoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateEnvironmentRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateEnvironmentRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAssetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAsset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAssetFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAssetFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAssetTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAssetType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataProductSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataProduct(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataSourceRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataSourceRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDomainUnitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDomainUnit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEnvironmentActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEnvironmentAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEnvironmentBlueprintSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEnvironmentBlueprint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEnvironmentBlueprintConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEnvironmentBlueprintConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEnvironmentCredentialsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEnvironmentCredentials(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEnvironmentProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEnvironmentProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFormTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFormType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGlossarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGlossary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGlossaryTermSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGlossaryTerm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGroupProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGroupProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIamPortalLoginUrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIamPortalLoginUrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetJobRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetJobRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLineageEventSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLineageEvent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLineageNodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLineageNode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetListingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetListing(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMetadataGenerationRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMetadataGenerationRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetProjectProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetProjectProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSubscriptionGrantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSubscriptionGrant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSubscriptionRequestDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSubscriptionRequestDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSubscriptionTargetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSubscriptionTarget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTimeSeriesDataPointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTimeSeriesDataPoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUserProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUserProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssetFiltersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssetFilters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssetRevisionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssetRevisions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConnectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConnections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataProductRevisionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataProductRevisions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataSourceRunActivitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataSourceRunActivities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataSourceRunsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataSourceRuns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataSourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataSources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDomainsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDomains(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDomainUnitsForParentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDomainUnitsForParent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEntityOwnersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEntityOwners(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEnvironmentActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEnvironmentActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEnvironmentBlueprintConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEnvironmentBlueprintConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEnvironmentBlueprintsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEnvironmentBlueprints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEnvironmentProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEnvironmentProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEnvironmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEnvironments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJobRunsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJobRuns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLineageEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLineageEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLineageNodeHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLineageNodeHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMetadataGenerationRunsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMetadataGenerationRuns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNotificationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNotifications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPolicyGrantsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPolicyGrants(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProjectMembershipsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProjectMemberships(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProjectProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProjectProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProjectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProjects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSubscriptionGrantsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSubscriptionGrants(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSubscriptionRequestsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSubscriptionRequests(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSubscriptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSubscriptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSubscriptionTargetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSubscriptionTargets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTimeSeriesDataPointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTimeSeriesDataPoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPostLineageEventSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PostLineageEvent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPostTimeSeriesDataPointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PostTimeSeriesDataPoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutEnvironmentBlueprintConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutEnvironmentBlueprintConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRejectPredictionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RejectPredictions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRejectSubscriptionRequestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RejectSubscriptionRequest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveEntityOwnerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveEntityOwner(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemovePolicyGrantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemovePolicyGrant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRevokeSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RevokeSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Search(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchGroupProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchGroupProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchListingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchListings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchUserProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchUserProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDataSourceRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDataSourceRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMetadataGenerationRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMetadataGenerationRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAssetFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAssetFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDomainUnitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDomainUnit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEnvironmentActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEnvironmentAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEnvironmentProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEnvironmentProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGlossarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGlossary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGlossaryTermSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGlossaryTerm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGroupProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGroupProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProjectProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProjectProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSubscriptionGrantStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSubscriptionGrantStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSubscriptionRequestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSubscriptionRequest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSubscriptionTargetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSubscriptionTarget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUserProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/dax/generated.json b/service/dax/generated.json index 889e3274ccf..e7cf7baa4fc 100644 --- a/service/dax/generated.json +++ b/service/dax/generated.json @@ -42,6 +42,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/dax/sra_operation_order_test.go b/service/dax/sra_operation_order_test.go new file mode 100644 index 00000000000..2c9fddf915f --- /dev/null +++ b/service/dax/sra_operation_order_test.go @@ -0,0 +1,756 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package dax + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSubnetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSubnetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDecreaseReplicationFactorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DecreaseReplicationFactor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSubnetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSubnetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDefaultParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDefaultParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeParameterGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeParameterGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSubnetGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSubnetGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpIncreaseReplicationFactorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.IncreaseReplicationFactor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRebootNodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RebootNode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSubnetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSubnetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/deadline/generated.json b/service/deadline/generated.json index 07feb3fb095..9b3746c5946 100644 --- a/service/deadline/generated.json +++ b/service/deadline/generated.json @@ -138,6 +138,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/deadline/sra_operation_order_test.go b/service/deadline/sra_operation_order_test.go new file mode 100644 index 00000000000..fbcc47a990f --- /dev/null +++ b/service/deadline/sra_operation_order_test.go @@ -0,0 +1,3976 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package deadline + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateMemberToFarmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateMemberToFarm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateMemberToFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateMemberToFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateMemberToJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateMemberToJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateMemberToQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateMemberToQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssumeFleetRoleForReadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssumeFleetRoleForRead(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssumeFleetRoleForWorkerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssumeFleetRoleForWorker(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssumeQueueRoleForReadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssumeQueueRoleForRead(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssumeQueueRoleForUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssumeQueueRoleForUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssumeQueueRoleForWorkerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssumeQueueRoleForWorker(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetJobEntitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetJobEntity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCopyJobTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopyJobTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBudgetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBudget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFarmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFarm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLicenseEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLicenseEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLimitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLimit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMonitorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMonitor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateQueueEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateQueueEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateQueueFleetAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateQueueFleetAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateQueueLimitAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateQueueLimitAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStorageProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStorageProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorkerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorker(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBudgetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBudget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFarmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFarm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLicenseEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLicenseEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLimitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLimit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMeteredProductSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMeteredProduct(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMonitorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMonitor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteQueueEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteQueueEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteQueueFleetAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteQueueFleetAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteQueueLimitAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteQueueLimitAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteStorageProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteStorageProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWorkerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWorker(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateMemberFromFarmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateMemberFromFarm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateMemberFromFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateMemberFromFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateMemberFromJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateMemberFromJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateMemberFromQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateMemberFromQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBudgetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBudget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFarmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFarm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLicenseEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLicenseEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLimitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLimit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMonitorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMonitor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQueueEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQueueEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQueueFleetAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQueueFleetAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQueueLimitAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQueueLimitAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSessionActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSessionAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSessionsStatisticsAggregationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSessionsStatisticsAggregation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStepSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStep(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStorageProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStorageProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStorageProfileForQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStorageProfileForQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWorkerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWorker(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAvailableMeteredProductsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAvailableMeteredProducts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBudgetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBudgets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFarmMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFarmMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFarmsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFarms(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFleetMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFleetMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFleetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFleets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJobMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJobMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJobParameterDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJobParameterDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLicenseEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLicenseEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLimitsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLimits(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMeteredProductsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMeteredProducts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMonitorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMonitors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListQueueEnvironmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListQueueEnvironments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListQueueFleetAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListQueueFleetAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListQueueLimitAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListQueueLimitAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListQueueMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListQueueMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListQueuesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListQueues(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSessionActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSessionActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSessionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSessions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSessionsForWorkerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSessionsForWorker(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStepConsumersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStepConsumers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStepDependenciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStepDependencies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStepsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSteps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStorageProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStorageProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStorageProfilesForQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStorageProfilesForQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutMeteredProductSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutMeteredProduct(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchStepsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchSteps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchWorkersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchWorkers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartSessionsStatisticsAggregationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartSessionsStatisticsAggregation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBudgetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBudget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFarmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFarm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLimitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLimit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMonitorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMonitor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateQueueEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateQueueEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateQueueFleetAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateQueueFleetAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateQueueLimitAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateQueueLimitAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateStepSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateStep(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateStorageProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateStorageProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWorkerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWorker(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWorkerScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWorkerSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/detective/generated.json b/service/detective/generated.json index 41b2e875d05..8738e6792ff 100644 --- a/service/detective/generated.json +++ b/service/detective/generated.json @@ -50,6 +50,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/detective/sra_operation_order_test.go b/service/detective/sra_operation_order_test.go new file mode 100644 index 00000000000..dc5fc8ae33d --- /dev/null +++ b/service/detective/sra_operation_order_test.go @@ -0,0 +1,1036 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package detective + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcceptInvitationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptInvitation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetGraphMemberDatasourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetGraphMemberDatasources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetMembershipDatasourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetMembershipDatasources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGraphSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGraph(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGraphSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGraph(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOrganizationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOrganizationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableOrganizationAdminAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableOrganizationAdminAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableOrganizationAdminAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableOrganizationAdminAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInvestigationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInvestigation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDatasourcePackagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDatasourcePackages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGraphsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGraphs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIndicatorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIndicators(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInvestigationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInvestigations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInvitationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInvitations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOrganizationAdminAccountsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOrganizationAdminAccounts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRejectInvitationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RejectInvitation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartInvestigationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartInvestigation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMonitoringMemberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMonitoringMember(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDatasourcePackagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDatasourcePackages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateInvestigationStateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateInvestigationState(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateOrganizationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateOrganizationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/devicefarm/generated.json b/service/devicefarm/generated.json index 24471536c13..9827aa923c8 100644 --- a/service/devicefarm/generated.json +++ b/service/devicefarm/generated.json @@ -98,6 +98,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/devicefarm/sra_operation_order_test.go b/service/devicefarm/sra_operation_order_test.go new file mode 100644 index 00000000000..0cec807b651 --- /dev/null +++ b/service/devicefarm/sra_operation_order_test.go @@ -0,0 +1,2716 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devicefarm + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateDevicePoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDevicePool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInstanceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInstanceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateNetworkProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNetworkProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRemoteAccessSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRemoteAccessSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTestGridProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTestGridProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTestGridUrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTestGridUrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUploadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUpload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVPCEConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVPCEConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDevicePoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDevicePool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInstanceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInstanceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNetworkProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNetworkProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRemoteAccessSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRemoteAccessSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTestGridProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTestGridProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUploadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUpload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVPCEConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVPCEConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccountSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccountSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeviceInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeviceInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDevicePoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDevicePool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDevicePoolCompatibilitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDevicePoolCompatibility(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInstanceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInstanceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetNetworkProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetNetworkProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOfferingStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOfferingStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRemoteAccessSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRemoteAccessSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSuiteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSuite(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTestGridProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTestGridProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTestGridSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTestGridSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUploadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUpload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVPCEConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVPCEConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInstallToRemoteAccessSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InstallToRemoteAccessSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListArtifactsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListArtifacts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDeviceInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDeviceInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDevicePoolsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDevicePools(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDevicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDevices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInstanceProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInstanceProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNetworkProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNetworkProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOfferingPromotionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOfferingPromotions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOfferingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOfferings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOfferingTransactionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOfferingTransactions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProjectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProjects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRemoteAccessSessionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRemoteAccessSessions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRunsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRuns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSamplesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSamples(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSuitesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSuites(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTestGridProjectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTestGridProjects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTestGridSessionActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTestGridSessionActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTestGridSessionArtifactsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTestGridSessionArtifacts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTestGridSessionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTestGridSessions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTestsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTests(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUniqueProblemsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUniqueProblems(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUploadsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUploads(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVPCEConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVPCEConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPurchaseOfferingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PurchaseOffering(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRenewOfferingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RenewOffering(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpScheduleRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ScheduleRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopRemoteAccessSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopRemoteAccessSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDeviceInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDeviceInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDevicePoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDevicePool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateInstanceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateInstanceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateNetworkProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateNetworkProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTestGridProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTestGridProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUploadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUpload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVPCEConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVPCEConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/devopsguru/generated.json b/service/devopsguru/generated.json index 611a159cfb2..5a26453732f 100644 --- a/service/devopsguru/generated.json +++ b/service/devopsguru/generated.json @@ -52,6 +52,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/devopsguru/sra_operation_order_test.go b/service/devopsguru/sra_operation_order_test.go new file mode 100644 index 00000000000..7e0c5fce647 --- /dev/null +++ b/service/devopsguru/sra_operation_order_test.go @@ -0,0 +1,1106 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devopsguru + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddNotificationChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddNotificationChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInsightSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInsight(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccountHealthSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccountHealth(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccountOverviewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccountOverview(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAnomalySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAnomaly(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventSourcesConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEventSourcesConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFeedbackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFeedback(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInsightSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInsight(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOrganizationHealthSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOrganizationHealth(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOrganizationOverviewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOrganizationOverview(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOrganizationResourceCollectionHealthSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOrganizationResourceCollectionHealth(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeResourceCollectionHealthSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeResourceCollectionHealth(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeServiceIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeServiceIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCostEstimationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCostEstimation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourceCollectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourceCollection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAnomaliesForInsightSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAnomaliesForInsight(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAnomalousLogGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAnomalousLogGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInsightsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInsights(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMonitoredResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMonitoredResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNotificationChannelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNotificationChannels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOrganizationInsightsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOrganizationInsights(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutFeedbackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutFeedback(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveNotificationChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveNotificationChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchInsightsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchInsights(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchOrganizationInsightsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchOrganizationInsights(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartCostEstimationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartCostEstimation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEventSourcesConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEventSourcesConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateResourceCollectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateResourceCollection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateServiceIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateServiceIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/directconnect/generated.json b/service/directconnect/generated.json index d17e962587a..387c621c48a 100644 --- a/service/directconnect/generated.json +++ b/service/directconnect/generated.json @@ -84,6 +84,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/directconnect/sra_operation_order_test.go b/service/directconnect/sra_operation_order_test.go new file mode 100644 index 00000000000..804f9097dc9 --- /dev/null +++ b/service/directconnect/sra_operation_order_test.go @@ -0,0 +1,2226 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package directconnect + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcceptDirectConnectGatewayAssociationProposalSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptDirectConnectGatewayAssociationProposal(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAllocateConnectionOnInterconnectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AllocateConnectionOnInterconnect(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAllocateHostedConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AllocateHostedConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAllocatePrivateVirtualInterfaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AllocatePrivateVirtualInterface(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAllocatePublicVirtualInterfaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AllocatePublicVirtualInterface(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAllocateTransitVirtualInterfaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AllocateTransitVirtualInterface(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateConnectionWithLagSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateConnectionWithLag(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateHostedConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateHostedConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateMacSecKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateMacSecKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateVirtualInterfaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateVirtualInterface(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpConfirmConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ConfirmConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpConfirmCustomerAgreementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ConfirmCustomerAgreement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpConfirmPrivateVirtualInterfaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ConfirmPrivateVirtualInterface(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpConfirmPublicVirtualInterfaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ConfirmPublicVirtualInterface(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpConfirmTransitVirtualInterfaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ConfirmTransitVirtualInterface(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBGPPeerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBGPPeer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDirectConnectGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDirectConnectGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDirectConnectGatewayAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDirectConnectGatewayAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDirectConnectGatewayAssociationProposalSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDirectConnectGatewayAssociationProposal(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInterconnectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInterconnect(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLagSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLag(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePrivateVirtualInterfaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePrivateVirtualInterface(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePublicVirtualInterfaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePublicVirtualInterface(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTransitVirtualInterfaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTransitVirtualInterface(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBGPPeerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBGPPeer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDirectConnectGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDirectConnectGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDirectConnectGatewayAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDirectConnectGatewayAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDirectConnectGatewayAssociationProposalSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDirectConnectGatewayAssociationProposal(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInterconnectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInterconnect(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLagSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLag(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVirtualInterfaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVirtualInterface(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConnectionLoaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConnectionLoa(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConnectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConnections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConnectionsOnInterconnectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConnectionsOnInterconnect(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCustomerMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCustomerMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDirectConnectGatewayAssociationProposalsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDirectConnectGatewayAssociationProposals(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDirectConnectGatewayAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDirectConnectGatewayAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDirectConnectGatewayAttachmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDirectConnectGatewayAttachments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDirectConnectGatewaysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDirectConnectGateways(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeHostedConnectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeHostedConnections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInterconnectLoaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInterconnectLoa(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInterconnectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInterconnects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLoaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLoa(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLocationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLocations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRouterConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRouterConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVirtualGatewaysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVirtualGateways(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVirtualInterfacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVirtualInterfaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateConnectionFromLagSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateConnectionFromLag(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateMacSecKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateMacSecKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVirtualInterfaceTestHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVirtualInterfaceTestHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartBgpFailoverTestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartBgpFailoverTest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopBgpFailoverTestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopBgpFailoverTest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDirectConnectGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDirectConnectGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDirectConnectGatewayAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDirectConnectGatewayAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLagSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLag(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVirtualInterfaceAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVirtualInterfaceAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/directoryservice/generated.json b/service/directoryservice/generated.json index 4e498abdf75..1c7382af3d8 100644 --- a/service/directoryservice/generated.json +++ b/service/directoryservice/generated.json @@ -91,6 +91,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/directoryservice/sra_operation_order_test.go b/service/directoryservice/sra_operation_order_test.go new file mode 100644 index 00000000000..ec80972c901 --- /dev/null +++ b/service/directoryservice/sra_operation_order_test.go @@ -0,0 +1,2471 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package directoryservice + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcceptSharedDirectorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptSharedDirectory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddIpRoutesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddIpRoutes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddRegionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddRegion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddTagsToResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddTagsToResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelSchemaExtensionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelSchemaExtension(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpConnectDirectorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ConnectDirectory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateComputerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateComputer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConditionalForwarderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConditionalForwarder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDirectorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDirectory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLogSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLogSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMicrosoftADSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMicrosoftAD(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTrustSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTrust(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConditionalForwarderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConditionalForwarder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDirectorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDirectory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLogSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLogSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTrustSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTrust(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterEventTopicSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterEventTopic(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClientAuthenticationSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeClientAuthenticationSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConditionalForwardersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConditionalForwarders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDirectoriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDirectories(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDirectoryDataAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDirectoryDataAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDomainControllersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDomainControllers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventTopicsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEventTopics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLDAPSSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLDAPSSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRegionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRegions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSharedDirectoriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSharedDirectories(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSnapshotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSnapshots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTrustsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTrusts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeUpdateDirectorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeUpdateDirectory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableClientAuthenticationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableClientAuthentication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableDirectoryDataAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableDirectoryDataAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableLDAPSSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableLDAPS(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableRadiusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableRadius(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableSsoSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableSso(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableClientAuthenticationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableClientAuthentication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableDirectoryDataAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableDirectoryDataAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableLDAPSSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableLDAPS(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableRadiusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableRadius(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableSsoSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableSso(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDirectoryLimitsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDirectoryLimits(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSnapshotLimitsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSnapshotLimits(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCertificatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCertificates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIpRoutesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIpRoutes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLogSubscriptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLogSubscriptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSchemaExtensionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSchemaExtensions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterEventTopicSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterEventTopic(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRejectSharedDirectorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RejectSharedDirectory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveIpRoutesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveIpRoutes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveRegionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveRegion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveTagsFromResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveTagsFromResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetUserPasswordSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetUserPassword(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreFromSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreFromSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpShareDirectorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ShareDirectory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartSchemaExtensionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartSchemaExtension(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUnshareDirectorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UnshareDirectory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConditionalForwarderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConditionalForwarder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDirectorySetupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDirectorySetup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateNumberOfDomainControllersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateNumberOfDomainControllers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRadiusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRadius(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTrustSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTrust(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpVerifyTrustSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.VerifyTrust(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/directoryservicedata/generated.json b/service/directoryservicedata/generated.json index 0e4788c88ff..c44cb55f794 100644 --- a/service/directoryservicedata/generated.json +++ b/service/directoryservicedata/generated.json @@ -38,6 +38,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/directoryservicedata/sra_operation_order_test.go b/service/directoryservicedata/sra_operation_order_test.go new file mode 100644 index 00000000000..7f8c1388b07 --- /dev/null +++ b/service/directoryservicedata/sra_operation_order_test.go @@ -0,0 +1,616 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package directoryservicedata + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddGroupMemberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddGroupMember(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGroupMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGroupMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGroupsForMemberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGroupsForMember(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUsersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUsers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveGroupMemberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveGroupMember(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchUsersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchUsers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/dlm/generated.json b/service/dlm/generated.json index 1f70e7e81f0..478c03dd87c 100644 --- a/service/dlm/generated.json +++ b/service/dlm/generated.json @@ -29,6 +29,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/dlm/sra_operation_order_test.go b/service/dlm/sra_operation_order_test.go new file mode 100644 index 00000000000..5319a2b208f --- /dev/null +++ b/service/dlm/sra_operation_order_test.go @@ -0,0 +1,301 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package dlm + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateLifecyclePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLifecyclePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLifecyclePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLifecyclePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLifecyclePoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLifecyclePolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLifecyclePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLifecyclePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLifecyclePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLifecyclePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/docdb/generated.json b/service/docdb/generated.json index bea1220ca81..e58bc53aae9 100644 --- a/service/docdb/generated.json +++ b/service/docdb/generated.json @@ -80,6 +80,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/docdb/sra_operation_order_test.go b/service/docdb/sra_operation_order_test.go new file mode 100644 index 00000000000..1935cf20fd6 --- /dev/null +++ b/service/docdb/sra_operation_order_test.go @@ -0,0 +1,1946 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package docdb + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddSourceIdentifierToSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddSourceIdentifierToSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddTagsToResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddTagsToResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpApplyPendingMaintenanceActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ApplyPendingMaintenanceAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCopyDBClusterParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopyDBClusterParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCopyDBClusterSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopyDBClusterSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDBClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDBCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDBClusterParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDBClusterParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDBClusterSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDBClusterSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDBInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDBInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDBSubnetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDBSubnetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEventSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEventSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGlobalClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGlobalCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDBClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDBCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDBClusterParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDBClusterParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDBClusterSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDBClusterSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDBInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDBInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDBSubnetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDBSubnetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEventSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEventSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGlobalClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGlobalCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCertificatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCertificates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBClusterParameterGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBClusterParameterGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBClusterParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBClusterParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBClusterSnapshotAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBClusterSnapshotAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBClusterSnapshotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBClusterSnapshots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBEngineVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBEngineVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBSubnetGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBSubnetGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEngineDefaultClusterParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEngineDefaultClusterParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventCategoriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEventCategories(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventSubscriptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEventSubscriptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGlobalClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGlobalClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOrderableDBInstanceOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOrderableDBInstanceOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePendingMaintenanceActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePendingMaintenanceActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpFailoverDBClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.FailoverDBCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpFailoverGlobalClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.FailoverGlobalCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDBClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDBCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDBClusterParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDBClusterParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDBClusterSnapshotAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDBClusterSnapshotAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDBInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDBInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDBSubnetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDBSubnetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyEventSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyEventSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyGlobalClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyGlobalCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRebootDBInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RebootDBInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveFromGlobalClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveFromGlobalCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveSourceIdentifierFromSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveSourceIdentifierFromSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveTagsFromResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveTagsFromResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetDBClusterParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetDBClusterParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreDBClusterFromSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreDBClusterFromSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreDBClusterToPointInTimeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreDBClusterToPointInTime(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDBClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDBCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopDBClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopDBCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSwitchoverGlobalClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SwitchoverGlobalCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/docdbelastic/generated.json b/service/docdbelastic/generated.json index c6b1f3cacde..d6d9bbccfb5 100644 --- a/service/docdbelastic/generated.json +++ b/service/docdbelastic/generated.json @@ -40,6 +40,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/docdbelastic/sra_operation_order_test.go b/service/docdbelastic/sra_operation_order_test.go new file mode 100644 index 00000000000..b870eb65897 --- /dev/null +++ b/service/docdbelastic/sra_operation_order_test.go @@ -0,0 +1,686 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package docdbelastic + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpApplyPendingMaintenanceActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ApplyPendingMaintenanceAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCopyClusterSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopyClusterSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateClusterSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateClusterSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteClusterSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteClusterSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetClusterSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetClusterSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPendingMaintenanceActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPendingMaintenanceAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListClusterSnapshotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListClusterSnapshots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPendingMaintenanceActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPendingMaintenanceActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreClusterFromSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreClusterFromSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/drs/generated.json b/service/drs/generated.json index 57edb27a6ce..c5391ad3a8d 100644 --- a/service/drs/generated.json +++ b/service/drs/generated.json @@ -71,6 +71,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/drs/sra_operation_order_test.go b/service/drs/sra_operation_order_test.go new file mode 100644 index 00000000000..f7a3662626c --- /dev/null +++ b/service/drs/sra_operation_order_test.go @@ -0,0 +1,1771 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package drs + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateSourceNetworkStackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateSourceNetworkStack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateExtendedSourceServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateExtendedSourceServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLaunchConfigurationTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLaunchConfigurationTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateReplicationConfigurationTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateReplicationConfigurationTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSourceNetworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSourceNetwork(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLaunchActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLaunchAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLaunchConfigurationTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLaunchConfigurationTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRecoveryInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRecoveryInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteReplicationConfigurationTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteReplicationConfigurationTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSourceNetworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSourceNetwork(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSourceServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSourceServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeJobLogItemsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeJobLogItems(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLaunchConfigurationTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLaunchConfigurationTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRecoveryInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRecoveryInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRecoverySnapshotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRecoverySnapshots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReplicationConfigurationTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReplicationConfigurationTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSourceNetworksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSourceNetworks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSourceServersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSourceServers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisconnectRecoveryInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisconnectRecoveryInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisconnectSourceServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisconnectSourceServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportSourceNetworkCfnTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportSourceNetworkCfnTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFailbackReplicationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFailbackReplicationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLaunchConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLaunchConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReplicationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReplicationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInitializeServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InitializeService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListExtensibleSourceServersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListExtensibleSourceServers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLaunchActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLaunchActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStagingAccountsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStagingAccounts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutLaunchActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutLaunchAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRetryDataReplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RetryDataReplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReverseReplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReverseReplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartFailbackLaunchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartFailbackLaunch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartRecoverySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartRecovery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartReplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartReplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartSourceNetworkRecoverySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartSourceNetworkRecovery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartSourceNetworkReplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartSourceNetworkReplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopFailbackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopFailback(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopReplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopReplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopSourceNetworkReplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopSourceNetworkReplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTerminateRecoveryInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TerminateRecoveryInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFailbackReplicationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFailbackReplicationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLaunchConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLaunchConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLaunchConfigurationTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLaunchConfigurationTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateReplicationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateReplicationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateReplicationConfigurationTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateReplicationConfigurationTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/dsql/generated.json b/service/dsql/generated.json index b3225274ff5..d0bd1c07c47 100644 --- a/service/dsql/generated.json +++ b/service/dsql/generated.json @@ -31,6 +31,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/dsql/sra_operation_order_test.go b/service/dsql/sra_operation_order_test.go new file mode 100644 index 00000000000..278363129f8 --- /dev/null +++ b/service/dsql/sra_operation_order_test.go @@ -0,0 +1,371 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package dsql + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMultiRegionClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMultiRegionClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMultiRegionClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMultiRegionClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/dynamodb/generated.json b/service/dynamodb/generated.json index d8eed47d5ad..b2746adbd16 100644 --- a/service/dynamodb/generated.json +++ b/service/dynamodb/generated.json @@ -80,6 +80,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/dynamodb/sra_operation_order_test.go b/service/dynamodb/sra_operation_order_test.go new file mode 100644 index 00000000000..26e015c522c --- /dev/null +++ b/service/dynamodb/sra_operation_order_test.go @@ -0,0 +1,2016 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package dynamodb + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchExecuteStatementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchExecuteStatement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetItemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetItem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchWriteItemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchWriteItem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBackupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBackup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGlobalTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGlobalTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBackupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBackup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteItemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteItem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBackupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBackup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeContinuousBackupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeContinuousBackups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeContributorInsightsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeContributorInsights(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGlobalTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGlobalTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGlobalTableSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGlobalTableSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeImportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeImport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeKinesisStreamingDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeKinesisStreamingDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLimitsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLimits(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTableReplicaAutoScalingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTableReplicaAutoScaling(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTimeToLiveSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTimeToLive(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableKinesisStreamingDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableKinesisStreamingDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableKinesisStreamingDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableKinesisStreamingDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExecuteStatementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExecuteStatement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExecuteTransactionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExecuteTransaction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportTableToPointInTimeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportTableToPointInTime(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetItemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetItem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBackupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBackups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListContributorInsightsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListContributorInsights(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListExportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListExports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGlobalTablesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGlobalTables(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListImportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListImports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTablesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTables(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsOfResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsOfResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutItemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutItem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Query(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreTableFromBackupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreTableFromBackup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreTableToPointInTimeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreTableToPointInTime(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpScanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Scan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTransactGetItemsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TransactGetItems(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTransactWriteItemsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TransactWriteItems(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateContinuousBackupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateContinuousBackups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateContributorInsightsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateContributorInsights(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGlobalTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGlobalTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGlobalTableSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGlobalTableSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateItemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateItem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateKinesisStreamingDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateKinesisStreamingDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTableReplicaAutoScalingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTableReplicaAutoScaling(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTimeToLiveSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTimeToLive(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/dynamodbstreams/generated.json b/service/dynamodbstreams/generated.json index 63355c333f4..7a6f1dc034d 100644 --- a/service/dynamodbstreams/generated.json +++ b/service/dynamodbstreams/generated.json @@ -25,6 +25,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/dynamodbstreams/sra_operation_order_test.go b/service/dynamodbstreams/sra_operation_order_test.go new file mode 100644 index 00000000000..65d13082d3b --- /dev/null +++ b/service/dynamodbstreams/sra_operation_order_test.go @@ -0,0 +1,161 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package dynamodbstreams + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpDescribeStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRecordsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRecords(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetShardIteratorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetShardIterator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStreamsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStreams(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/ebs/generated.json b/service/ebs/generated.json index 69d4bbf33d3..d4e74775350 100644 --- a/service/ebs/generated.json +++ b/service/ebs/generated.json @@ -27,6 +27,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/ebs/sra_operation_order_test.go b/service/ebs/sra_operation_order_test.go new file mode 100644 index 00000000000..528a0f4d14d --- /dev/null +++ b/service/ebs/sra_operation_order_test.go @@ -0,0 +1,231 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ebs + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCompleteSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CompleteSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSnapshotBlockSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSnapshotBlock(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListChangedBlocksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListChangedBlocks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSnapshotBlocksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSnapshotBlocks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutSnapshotBlockSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutSnapshotBlock(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/ec2/generated.json b/service/ec2/generated.json index a10edff0be5..8d95a4e8222 100644 --- a/service/ec2/generated.json +++ b/service/ec2/generated.json @@ -682,6 +682,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/types.go", "validators.go" diff --git a/service/ec2/sra_operation_order_test.go b/service/ec2/sra_operation_order_test.go new file mode 100644 index 00000000000..9304555e679 --- /dev/null +++ b/service/ec2/sra_operation_order_test.go @@ -0,0 +1,23051 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ec2 + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcceptAddressTransferSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptAddressTransfer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAcceptCapacityReservationBillingOwnershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptCapacityReservationBillingOwnership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAcceptReservedInstancesExchangeQuoteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptReservedInstancesExchangeQuote(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAcceptTransitGatewayMulticastDomainAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptTransitGatewayMulticastDomainAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAcceptTransitGatewayPeeringAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptTransitGatewayPeeringAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAcceptTransitGatewayVpcAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptTransitGatewayVpcAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAcceptVpcEndpointConnectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptVpcEndpointConnections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAcceptVpcPeeringConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptVpcPeeringConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAdvertiseByoipCidrSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AdvertiseByoipCidr(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAllocateAddressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AllocateAddress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAllocateHostsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AllocateHosts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAllocateIpamPoolCidrSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AllocateIpamPoolCidr(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpApplySecurityGroupsToClientVpnTargetNetworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ApplySecurityGroupsToClientVpnTargetNetwork(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssignIpv6AddressesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssignIpv6Addresses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssignPrivateIpAddressesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssignPrivateIpAddresses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssignPrivateNatGatewayAddressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssignPrivateNatGatewayAddress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateAddressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateAddress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateCapacityReservationBillingOwnerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateCapacityReservationBillingOwner(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateClientVpnTargetNetworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateClientVpnTargetNetwork(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateDhcpOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateDhcpOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateEnclaveCertificateIamRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateEnclaveCertificateIamRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateIamInstanceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateIamInstanceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateInstanceEventWindowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateInstanceEventWindow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateIpamByoasnSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateIpamByoasn(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateIpamResourceDiscoverySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateIpamResourceDiscovery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateNatGatewayAddressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateNatGatewayAddress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateRouteTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateRouteTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateSecurityGroupVpcSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateSecurityGroupVpc(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateSubnetCidrBlockSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateSubnetCidrBlock(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateTransitGatewayMulticastDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateTransitGatewayMulticastDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateTransitGatewayPolicyTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateTransitGatewayPolicyTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateTransitGatewayRouteTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateTransitGatewayRouteTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateTrunkInterfaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateTrunkInterface(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateVpcCidrBlockSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateVpcCidrBlock(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachClassicLinkVpcSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachClassicLinkVpc(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachInternetGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachInternetGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachNetworkInterfaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachNetworkInterface(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachVerifiedAccessTrustProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachVerifiedAccessTrustProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachVolumeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachVolume(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachVpnGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachVpnGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAuthorizeClientVpnIngressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AuthorizeClientVpnIngress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAuthorizeSecurityGroupEgressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AuthorizeSecurityGroupEgress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAuthorizeSecurityGroupIngressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AuthorizeSecurityGroupIngress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBundleInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BundleInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelBundleTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelBundleTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelCapacityReservationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelCapacityReservation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelCapacityReservationFleetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelCapacityReservationFleets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelConversionTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelConversionTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelDeclarativePoliciesReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelDeclarativePoliciesReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelExportTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelExportTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelImageLaunchPermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelImageLaunchPermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelImportTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelImportTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelReservedInstancesListingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelReservedInstancesListing(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelSpotFleetRequestsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelSpotFleetRequests(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelSpotInstanceRequestsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelSpotInstanceRequests(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpConfirmProductInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ConfirmProductInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCopyFpgaImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopyFpgaImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCopyImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopyImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCopySnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopySnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCapacityReservationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCapacityReservation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCapacityReservationBySplittingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCapacityReservationBySplitting(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCapacityReservationFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCapacityReservationFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCarrierGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCarrierGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateClientVpnEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateClientVpnEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateClientVpnRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateClientVpnRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCoipCidrSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCoipCidr(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCoipPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCoipPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCustomerGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCustomerGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDefaultSubnetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDefaultSubnet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDefaultVpcSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDefaultVpc(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDhcpOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDhcpOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEgressOnlyInternetGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEgressOnlyInternetGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFlowLogsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFlowLogs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFpgaImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFpgaImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInstanceConnectEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInstanceConnectEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInstanceEventWindowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInstanceEventWindow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInstanceExportTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInstanceExportTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInternetGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInternetGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIpamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIpam(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIpamExternalResourceVerificationTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIpamExternalResourceVerificationToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIpamPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIpamPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIpamResourceDiscoverySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIpamResourceDiscovery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIpamScopeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIpamScope(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateKeyPairSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateKeyPair(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLaunchTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLaunchTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLaunchTemplateVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLaunchTemplateVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLocalGatewayRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLocalGatewayRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLocalGatewayRouteTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLocalGatewayRouteTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLocalGatewayRouteTableVirtualInterfaceGroupAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLocalGatewayRouteTableVirtualInterfaceGroupAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLocalGatewayRouteTableVpcAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLocalGatewayRouteTableVpcAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateManagedPrefixListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateManagedPrefixList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateNatGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNatGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateNetworkAclSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNetworkAcl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateNetworkAclEntrySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNetworkAclEntry(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateNetworkInsightsAccessScopeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNetworkInsightsAccessScope(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateNetworkInsightsPathSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNetworkInsightsPath(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateNetworkInterfaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNetworkInterface(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateNetworkInterfacePermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNetworkInterfacePermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePlacementGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePlacementGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePublicIpv4PoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePublicIpv4Pool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateReplaceRootVolumeTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateReplaceRootVolumeTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateReservedInstancesListingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateReservedInstancesListing(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRestoreImageTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRestoreImageTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRouteTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRouteTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSecurityGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSecurityGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSnapshotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSnapshots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSpotDatafeedSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSpotDatafeedSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStoreImageTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStoreImageTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSubnetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSubnet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSubnetCidrReservationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSubnetCidrReservation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTrafficMirrorFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTrafficMirrorFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTrafficMirrorFilterRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTrafficMirrorFilterRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTrafficMirrorSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTrafficMirrorSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTrafficMirrorTargetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTrafficMirrorTarget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTransitGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTransitGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTransitGatewayConnectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTransitGatewayConnect(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTransitGatewayConnectPeerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTransitGatewayConnectPeer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTransitGatewayMulticastDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTransitGatewayMulticastDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTransitGatewayPeeringAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTransitGatewayPeeringAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTransitGatewayPolicyTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTransitGatewayPolicyTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTransitGatewayPrefixListReferenceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTransitGatewayPrefixListReference(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTransitGatewayRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTransitGatewayRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTransitGatewayRouteTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTransitGatewayRouteTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTransitGatewayRouteTableAnnouncementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTransitGatewayRouteTableAnnouncement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTransitGatewayVpcAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTransitGatewayVpcAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVerifiedAccessEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVerifiedAccessEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVerifiedAccessGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVerifiedAccessGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVerifiedAccessInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVerifiedAccessInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVerifiedAccessTrustProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVerifiedAccessTrustProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVolumeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVolume(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVpcSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVpc(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVpcBlockPublicAccessExclusionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVpcBlockPublicAccessExclusion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVpcEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVpcEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVpcEndpointConnectionNotificationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVpcEndpointConnectionNotification(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVpcEndpointServiceConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVpcEndpointServiceConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVpcPeeringConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVpcPeeringConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVpnConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVpnConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVpnConnectionRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVpnConnectionRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVpnGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVpnGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCarrierGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCarrierGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteClientVpnEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteClientVpnEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteClientVpnRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteClientVpnRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCoipCidrSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCoipCidr(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCoipPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCoipPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCustomerGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCustomerGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDhcpOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDhcpOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEgressOnlyInternetGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEgressOnlyInternetGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFleetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFleets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFlowLogsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFlowLogs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFpgaImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFpgaImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInstanceConnectEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInstanceConnectEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInstanceEventWindowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInstanceEventWindow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInternetGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInternetGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIpamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIpam(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIpamExternalResourceVerificationTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIpamExternalResourceVerificationToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIpamPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIpamPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIpamResourceDiscoverySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIpamResourceDiscovery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIpamScopeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIpamScope(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteKeyPairSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteKeyPair(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLaunchTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLaunchTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLaunchTemplateVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLaunchTemplateVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLocalGatewayRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLocalGatewayRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLocalGatewayRouteTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLocalGatewayRouteTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLocalGatewayRouteTableVirtualInterfaceGroupAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLocalGatewayRouteTableVpcAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLocalGatewayRouteTableVpcAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteManagedPrefixListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteManagedPrefixList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNatGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNatGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNetworkAclSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNetworkAcl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNetworkAclEntrySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNetworkAclEntry(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNetworkInsightsAccessScopeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNetworkInsightsAccessScope(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNetworkInsightsAccessScopeAnalysisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNetworkInsightsAccessScopeAnalysis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNetworkInsightsAnalysisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNetworkInsightsAnalysis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNetworkInsightsPathSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNetworkInsightsPath(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNetworkInterfaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNetworkInterface(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNetworkInterfacePermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNetworkInterfacePermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePlacementGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePlacementGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePublicIpv4PoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePublicIpv4Pool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteQueuedReservedInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteQueuedReservedInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRouteTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRouteTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSecurityGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSecurityGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSpotDatafeedSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSpotDatafeedSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSubnetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSubnet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSubnetCidrReservationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSubnetCidrReservation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTrafficMirrorFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTrafficMirrorFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTrafficMirrorFilterRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTrafficMirrorFilterRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTrafficMirrorSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTrafficMirrorSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTrafficMirrorTargetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTrafficMirrorTarget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTransitGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTransitGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTransitGatewayConnectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTransitGatewayConnect(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTransitGatewayConnectPeerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTransitGatewayConnectPeer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTransitGatewayMulticastDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTransitGatewayMulticastDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTransitGatewayPeeringAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTransitGatewayPeeringAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTransitGatewayPolicyTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTransitGatewayPolicyTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTransitGatewayPrefixListReferenceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTransitGatewayPrefixListReference(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTransitGatewayRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTransitGatewayRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTransitGatewayRouteTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTransitGatewayRouteTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTransitGatewayRouteTableAnnouncementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTransitGatewayRouteTableAnnouncement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTransitGatewayVpcAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTransitGatewayVpcAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVerifiedAccessEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVerifiedAccessEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVerifiedAccessGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVerifiedAccessGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVerifiedAccessInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVerifiedAccessInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVerifiedAccessTrustProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVerifiedAccessTrustProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVolumeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVolume(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVpcSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVpc(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVpcBlockPublicAccessExclusionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVpcBlockPublicAccessExclusion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVpcEndpointConnectionNotificationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVpcEndpointConnectionNotifications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVpcEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVpcEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVpcEndpointServiceConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVpcEndpointServiceConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVpcPeeringConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVpcPeeringConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVpnConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVpnConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVpnConnectionRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVpnConnectionRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVpnGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVpnGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeprovisionByoipCidrSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeprovisionByoipCidr(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeprovisionIpamByoasnSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeprovisionIpamByoasn(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeprovisionIpamPoolCidrSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeprovisionIpamPoolCidr(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeprovisionPublicIpv4PoolCidrSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeprovisionPublicIpv4PoolCidr(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterInstanceEventNotificationAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterInstanceEventNotificationAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterTransitGatewayMulticastGroupMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterTransitGatewayMulticastGroupMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterTransitGatewayMulticastGroupSourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterTransitGatewayMulticastGroupSources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccountAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccountAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAddressesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAddresses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAddressesAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAddressesAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAddressTransfersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAddressTransfers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAggregateIdFormatSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAggregateIdFormat(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAvailabilityZonesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAvailabilityZones(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAwsNetworkPerformanceMetricSubscriptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAwsNetworkPerformanceMetricSubscriptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBundleTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBundleTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeByoipCidrsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeByoipCidrs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCapacityBlockExtensionHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCapacityBlockExtensionHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCapacityBlockExtensionOfferingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCapacityBlockExtensionOfferings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCapacityBlockOfferingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCapacityBlockOfferings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCapacityReservationBillingRequestsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCapacityReservationBillingRequests(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCapacityReservationFleetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCapacityReservationFleets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCapacityReservationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCapacityReservations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCarrierGatewaysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCarrierGateways(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClassicLinkInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeClassicLinkInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClientVpnAuthorizationRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeClientVpnAuthorizationRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClientVpnConnectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeClientVpnConnections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClientVpnEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeClientVpnEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClientVpnRoutesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeClientVpnRoutes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClientVpnTargetNetworksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeClientVpnTargetNetworks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCoipPoolsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCoipPools(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConversionTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConversionTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCustomerGatewaysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCustomerGateways(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDeclarativePoliciesReportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDeclarativePoliciesReports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDhcpOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDhcpOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEgressOnlyInternetGatewaysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEgressOnlyInternetGateways(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeElasticGpusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeElasticGpus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeExportImageTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeExportImageTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeExportTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeExportTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFastLaunchImagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFastLaunchImages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFastSnapshotRestoresSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFastSnapshotRestores(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFleetHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFleetHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFleetInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFleetInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFleetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFleets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFlowLogsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFlowLogs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFpgaImageAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFpgaImageAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFpgaImagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFpgaImages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeHostReservationOfferingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeHostReservationOfferings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeHostReservationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeHostReservations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeHostsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeHosts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIamInstanceProfileAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIamInstanceProfileAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIdentityIdFormatSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIdentityIdFormat(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIdFormatSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIdFormat(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeImageAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeImageAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeImagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeImages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeImportImageTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeImportImageTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeImportSnapshotTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeImportSnapshotTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInstanceAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInstanceAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInstanceConnectEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInstanceConnectEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInstanceCreditSpecificationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInstanceCreditSpecifications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInstanceEventNotificationAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInstanceEventNotificationAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInstanceEventWindowsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInstanceEventWindows(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInstanceImageMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInstanceImageMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInstanceStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInstanceStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInstanceTopologySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInstanceTopology(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInstanceTypeOfferingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInstanceTypeOfferings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInstanceTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInstanceTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInternetGatewaysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInternetGateways(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIpamByoasnSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIpamByoasn(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIpamExternalResourceVerificationTokensSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIpamExternalResourceVerificationTokens(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIpamPoolsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIpamPools(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIpamResourceDiscoveriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIpamResourceDiscoveries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIpamResourceDiscoveryAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIpamResourceDiscoveryAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIpamsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIpams(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIpamScopesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIpamScopes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIpv6PoolsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIpv6Pools(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeKeyPairsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeKeyPairs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLaunchTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLaunchTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLaunchTemplateVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLaunchTemplateVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLocalGatewayRouteTablesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLocalGatewayRouteTables(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLocalGatewayRouteTableVpcAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLocalGatewayRouteTableVpcAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLocalGatewaysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLocalGateways(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLocalGatewayVirtualInterfaceGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLocalGatewayVirtualInterfaceGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLocalGatewayVirtualInterfacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLocalGatewayVirtualInterfaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLockedSnapshotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLockedSnapshots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMacHostsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMacHosts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeManagedPrefixListsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeManagedPrefixLists(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMovingAddressesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMovingAddresses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeNatGatewaysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeNatGateways(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeNetworkAclsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeNetworkAcls(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeNetworkInsightsAccessScopeAnalysesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeNetworkInsightsAccessScopeAnalyses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeNetworkInsightsAccessScopesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeNetworkInsightsAccessScopes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeNetworkInsightsAnalysesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeNetworkInsightsAnalyses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeNetworkInsightsPathsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeNetworkInsightsPaths(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeNetworkInterfaceAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeNetworkInterfaceAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeNetworkInterfacePermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeNetworkInterfacePermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeNetworkInterfacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeNetworkInterfaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePlacementGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePlacementGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePrefixListsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePrefixLists(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePrincipalIdFormatSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePrincipalIdFormat(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePublicIpv4PoolsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePublicIpv4Pools(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRegionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRegions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReplaceRootVolumeTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReplaceRootVolumeTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReservedInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReservedInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReservedInstancesListingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReservedInstancesListings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReservedInstancesModificationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReservedInstancesModifications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReservedInstancesOfferingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReservedInstancesOfferings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRouteTablesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRouteTables(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeScheduledInstanceAvailabilitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeScheduledInstanceAvailability(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeScheduledInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeScheduledInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSecurityGroupReferencesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSecurityGroupReferences(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSecurityGroupRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSecurityGroupRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSecurityGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSecurityGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSecurityGroupVpcAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSecurityGroupVpcAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSnapshotAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSnapshotAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSnapshotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSnapshots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSnapshotTierStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSnapshotTierStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSpotDatafeedSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSpotDatafeedSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSpotFleetInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSpotFleetInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSpotFleetRequestHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSpotFleetRequestHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSpotFleetRequestsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSpotFleetRequests(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSpotInstanceRequestsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSpotInstanceRequests(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSpotPriceHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSpotPriceHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStaleSecurityGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStaleSecurityGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStoreImageTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStoreImageTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSubnetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSubnets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTrafficMirrorFilterRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTrafficMirrorFilterRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTrafficMirrorFiltersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTrafficMirrorFilters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTrafficMirrorSessionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTrafficMirrorSessions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTrafficMirrorTargetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTrafficMirrorTargets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTransitGatewayAttachmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTransitGatewayAttachments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTransitGatewayConnectPeersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTransitGatewayConnectPeers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTransitGatewayConnectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTransitGatewayConnects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTransitGatewayMulticastDomainsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTransitGatewayMulticastDomains(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTransitGatewayPeeringAttachmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTransitGatewayPeeringAttachments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTransitGatewayPolicyTablesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTransitGatewayPolicyTables(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTransitGatewayRouteTableAnnouncementsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTransitGatewayRouteTableAnnouncements(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTransitGatewayRouteTablesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTransitGatewayRouteTables(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTransitGatewaysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTransitGateways(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTransitGatewayVpcAttachmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTransitGatewayVpcAttachments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTrunkInterfaceAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTrunkInterfaceAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVerifiedAccessEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVerifiedAccessEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVerifiedAccessGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVerifiedAccessGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVerifiedAccessInstanceLoggingConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVerifiedAccessInstanceLoggingConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVerifiedAccessInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVerifiedAccessInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVerifiedAccessTrustProvidersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVerifiedAccessTrustProviders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVolumeAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVolumeAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVolumesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVolumes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVolumesModificationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVolumesModifications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVolumeStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVolumeStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVpcAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVpcAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVpcBlockPublicAccessExclusionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVpcBlockPublicAccessExclusions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVpcBlockPublicAccessOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVpcBlockPublicAccessOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVpcClassicLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVpcClassicLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVpcClassicLinkDnsSupportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVpcClassicLinkDnsSupport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVpcEndpointAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVpcEndpointAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVpcEndpointConnectionNotificationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVpcEndpointConnectionNotifications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVpcEndpointConnectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVpcEndpointConnections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVpcEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVpcEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVpcEndpointServiceConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVpcEndpointServiceConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVpcEndpointServicePermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVpcEndpointServicePermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVpcEndpointServicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVpcEndpointServices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVpcPeeringConnectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVpcPeeringConnections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVpcsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVpcs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVpnConnectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVpnConnections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVpnGatewaysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVpnGateways(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachClassicLinkVpcSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachClassicLinkVpc(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachInternetGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachInternetGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachNetworkInterfaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachNetworkInterface(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachVerifiedAccessTrustProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachVerifiedAccessTrustProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachVolumeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachVolume(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachVpnGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachVpnGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableAddressTransferSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableAddressTransfer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableAllowedImagesSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableAllowedImagesSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableAwsNetworkPerformanceMetricSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableAwsNetworkPerformanceMetricSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableEbsEncryptionByDefaultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableEbsEncryptionByDefault(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableFastLaunchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableFastLaunch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableFastSnapshotRestoresSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableFastSnapshotRestores(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableImageBlockPublicAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableImageBlockPublicAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableImageDeprecationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableImageDeprecation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableImageDeregistrationProtectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableImageDeregistrationProtection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableIpamOrganizationAdminAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableIpamOrganizationAdminAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableSerialConsoleAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableSerialConsoleAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableSnapshotBlockPublicAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableSnapshotBlockPublicAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableTransitGatewayRouteTablePropagationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableTransitGatewayRouteTablePropagation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableVgwRoutePropagationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableVgwRoutePropagation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableVpcClassicLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableVpcClassicLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableVpcClassicLinkDnsSupportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableVpcClassicLinkDnsSupport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateAddressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateAddress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateCapacityReservationBillingOwnerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateCapacityReservationBillingOwner(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateClientVpnTargetNetworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateClientVpnTargetNetwork(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateEnclaveCertificateIamRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateEnclaveCertificateIamRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateIamInstanceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateIamInstanceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateInstanceEventWindowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateInstanceEventWindow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateIpamByoasnSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateIpamByoasn(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateIpamResourceDiscoverySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateIpamResourceDiscovery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateNatGatewayAddressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateNatGatewayAddress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateRouteTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateRouteTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateSecurityGroupVpcSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateSecurityGroupVpc(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateSubnetCidrBlockSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateSubnetCidrBlock(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateTransitGatewayMulticastDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateTransitGatewayMulticastDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateTransitGatewayPolicyTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateTransitGatewayPolicyTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateTransitGatewayRouteTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateTransitGatewayRouteTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateTrunkInterfaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateTrunkInterface(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateVpcCidrBlockSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateVpcCidrBlock(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableAddressTransferSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableAddressTransfer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableAllowedImagesSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableAllowedImagesSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableAwsNetworkPerformanceMetricSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableAwsNetworkPerformanceMetricSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableEbsEncryptionByDefaultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableEbsEncryptionByDefault(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableFastLaunchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableFastLaunch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableFastSnapshotRestoresSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableFastSnapshotRestores(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableImageBlockPublicAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableImageBlockPublicAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableImageDeprecationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableImageDeprecation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableImageDeregistrationProtectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableImageDeregistrationProtection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableIpamOrganizationAdminAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableIpamOrganizationAdminAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableReachabilityAnalyzerOrganizationSharingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableReachabilityAnalyzerOrganizationSharing(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableSerialConsoleAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableSerialConsoleAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableSnapshotBlockPublicAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableSnapshotBlockPublicAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableTransitGatewayRouteTablePropagationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableTransitGatewayRouteTablePropagation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableVgwRoutePropagationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableVgwRoutePropagation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableVolumeIOSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableVolumeIO(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableVpcClassicLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableVpcClassicLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableVpcClassicLinkDnsSupportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableVpcClassicLinkDnsSupport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportClientVpnClientCertificateRevocationListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportClientVpnClientCertificateRevocationList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportClientVpnClientConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportClientVpnClientConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportTransitGatewayRoutesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportTransitGatewayRoutes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportVerifiedAccessInstanceClientConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportVerifiedAccessInstanceClientConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAllowedImagesSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAllowedImagesSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAssociatedEnclaveCertificateIamRolesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAssociatedEnclaveCertificateIamRoles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAssociatedIpv6PoolCidrsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAssociatedIpv6PoolCidrs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAwsNetworkPerformanceDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAwsNetworkPerformanceData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCapacityReservationUsageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCapacityReservationUsage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCoipPoolUsageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCoipPoolUsage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConsoleOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConsoleOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConsoleScreenshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConsoleScreenshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeclarativePoliciesReportSummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeclarativePoliciesReportSummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDefaultCreditSpecificationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDefaultCreditSpecification(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEbsDefaultKmsKeyIdSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEbsDefaultKmsKeyId(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEbsEncryptionByDefaultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEbsEncryptionByDefault(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFlowLogsIntegrationTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFlowLogsIntegrationTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGroupsForCapacityReservationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGroupsForCapacityReservation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetHostReservationPurchasePreviewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetHostReservationPurchasePreview(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetImageBlockPublicAccessStateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetImageBlockPublicAccessState(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInstanceMetadataDefaultsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInstanceMetadataDefaults(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInstanceTpmEkPubSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInstanceTpmEkPub(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInstanceTypesFromInstanceRequirementsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInstanceTypesFromInstanceRequirements(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInstanceUefiDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInstanceUefiData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIpamAddressHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIpamAddressHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIpamDiscoveredAccountsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIpamDiscoveredAccounts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIpamDiscoveredPublicAddressesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIpamDiscoveredPublicAddresses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIpamDiscoveredResourceCidrsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIpamDiscoveredResourceCidrs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIpamPoolAllocationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIpamPoolAllocations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIpamPoolCidrsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIpamPoolCidrs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIpamResourceCidrsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIpamResourceCidrs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLaunchTemplateDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLaunchTemplateData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetManagedPrefixListAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetManagedPrefixListAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetManagedPrefixListEntriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetManagedPrefixListEntries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetNetworkInsightsAccessScopeAnalysisFindingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetNetworkInsightsAccessScopeAnalysisFindings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetNetworkInsightsAccessScopeContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetNetworkInsightsAccessScopeContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPasswordDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPasswordData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReservedInstancesExchangeQuoteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReservedInstancesExchangeQuote(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSecurityGroupsForVpcSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSecurityGroupsForVpc(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSerialConsoleAccessStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSerialConsoleAccessStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSnapshotBlockPublicAccessStateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSnapshotBlockPublicAccessState(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSpotPlacementScoresSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSpotPlacementScores(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSubnetCidrReservationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSubnetCidrReservations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTransitGatewayAttachmentPropagationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTransitGatewayAttachmentPropagations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTransitGatewayMulticastDomainAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTransitGatewayMulticastDomainAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTransitGatewayPolicyTableAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTransitGatewayPolicyTableAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTransitGatewayPolicyTableEntriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTransitGatewayPolicyTableEntries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTransitGatewayPrefixListReferencesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTransitGatewayPrefixListReferences(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTransitGatewayRouteTableAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTransitGatewayRouteTableAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTransitGatewayRouteTablePropagationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTransitGatewayRouteTablePropagations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVerifiedAccessEndpointPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVerifiedAccessEndpointPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVerifiedAccessEndpointTargetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVerifiedAccessEndpointTargets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVerifiedAccessGroupPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVerifiedAccessGroupPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVpnConnectionDeviceSampleConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVpnConnectionDeviceSampleConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVpnConnectionDeviceTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVpnConnectionDeviceTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVpnTunnelReplacementStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVpnTunnelReplacementStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportClientVpnClientCertificateRevocationListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportClientVpnClientCertificateRevocationList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportKeyPairSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportKeyPair(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportVolumeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportVolume(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListImagesInRecycleBinSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListImagesInRecycleBin(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSnapshotsInRecycleBinSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSnapshotsInRecycleBin(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpLockSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.LockSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyAddressAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyAddressAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyAvailabilityZoneGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyAvailabilityZoneGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyCapacityReservationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyCapacityReservation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyCapacityReservationFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyCapacityReservationFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyClientVpnEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyClientVpnEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDefaultCreditSpecificationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDefaultCreditSpecification(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyEbsDefaultKmsKeyIdSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyEbsDefaultKmsKeyId(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyFpgaImageAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyFpgaImageAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyHostsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyHosts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyIdentityIdFormatSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyIdentityIdFormat(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyIdFormatSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyIdFormat(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyImageAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyImageAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyInstanceAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyInstanceAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyInstanceCapacityReservationAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyInstanceCapacityReservationAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyInstanceCpuOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyInstanceCpuOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyInstanceCreditSpecificationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyInstanceCreditSpecification(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyInstanceEventStartTimeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyInstanceEventStartTime(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyInstanceEventWindowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyInstanceEventWindow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyInstanceMaintenanceOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyInstanceMaintenanceOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyInstanceMetadataDefaultsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyInstanceMetadataDefaults(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyInstanceMetadataOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyInstanceMetadataOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyInstanceNetworkPerformanceOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyInstanceNetworkPerformanceOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyInstancePlacementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyInstancePlacement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyIpamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyIpam(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyIpamPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyIpamPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyIpamResourceCidrSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyIpamResourceCidr(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyIpamResourceDiscoverySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyIpamResourceDiscovery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyIpamScopeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyIpamScope(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyLaunchTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyLaunchTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyLocalGatewayRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyLocalGatewayRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyManagedPrefixListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyManagedPrefixList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyNetworkInterfaceAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyNetworkInterfaceAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyPrivateDnsNameOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyPrivateDnsNameOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyReservedInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyReservedInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifySecurityGroupRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifySecurityGroupRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifySnapshotAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifySnapshotAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifySnapshotTierSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifySnapshotTier(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifySpotFleetRequestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifySpotFleetRequest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifySubnetAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifySubnetAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyTrafficMirrorFilterNetworkServicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyTrafficMirrorFilterNetworkServices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyTrafficMirrorFilterRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyTrafficMirrorFilterRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyTrafficMirrorSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyTrafficMirrorSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyTransitGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyTransitGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyTransitGatewayPrefixListReferenceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyTransitGatewayPrefixListReference(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyTransitGatewayVpcAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyTransitGatewayVpcAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyVerifiedAccessEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyVerifiedAccessEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyVerifiedAccessEndpointPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyVerifiedAccessEndpointPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyVerifiedAccessGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyVerifiedAccessGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyVerifiedAccessGroupPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyVerifiedAccessGroupPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyVerifiedAccessInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyVerifiedAccessInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyVerifiedAccessInstanceLoggingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyVerifiedAccessInstanceLoggingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyVerifiedAccessTrustProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyVerifiedAccessTrustProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyVolumeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyVolume(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyVolumeAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyVolumeAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyVpcAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyVpcAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyVpcBlockPublicAccessExclusionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyVpcBlockPublicAccessExclusion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyVpcBlockPublicAccessOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyVpcBlockPublicAccessOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyVpcEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyVpcEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyVpcEndpointConnectionNotificationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyVpcEndpointConnectionNotification(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyVpcEndpointServiceConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyVpcEndpointServiceConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyVpcEndpointServicePayerResponsibilitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyVpcEndpointServicePayerResponsibility(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyVpcEndpointServicePermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyVpcEndpointServicePermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyVpcPeeringConnectionOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyVpcPeeringConnectionOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyVpcTenancySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyVpcTenancy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyVpnConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyVpnConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyVpnConnectionOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyVpnConnectionOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyVpnTunnelCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyVpnTunnelCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyVpnTunnelOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyVpnTunnelOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMonitorInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MonitorInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMoveAddressToVpcSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MoveAddressToVpc(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMoveByoipCidrToIpamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MoveByoipCidrToIpam(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMoveCapacityReservationInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MoveCapacityReservationInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpProvisionByoipCidrSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ProvisionByoipCidr(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpProvisionIpamByoasnSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ProvisionIpamByoasn(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpProvisionIpamPoolCidrSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ProvisionIpamPoolCidr(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpProvisionPublicIpv4PoolCidrSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ProvisionPublicIpv4PoolCidr(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPurchaseCapacityBlockSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PurchaseCapacityBlock(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPurchaseCapacityBlockExtensionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PurchaseCapacityBlockExtension(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPurchaseHostReservationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PurchaseHostReservation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPurchaseReservedInstancesOfferingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PurchaseReservedInstancesOffering(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPurchaseScheduledInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PurchaseScheduledInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRebootInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RebootInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterInstanceEventNotificationAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterInstanceEventNotificationAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterTransitGatewayMulticastGroupMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterTransitGatewayMulticastGroupMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterTransitGatewayMulticastGroupSourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterTransitGatewayMulticastGroupSources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRejectCapacityReservationBillingOwnershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RejectCapacityReservationBillingOwnership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRejectTransitGatewayMulticastDomainAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RejectTransitGatewayMulticastDomainAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRejectTransitGatewayPeeringAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RejectTransitGatewayPeeringAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRejectTransitGatewayVpcAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RejectTransitGatewayVpcAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRejectVpcEndpointConnectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RejectVpcEndpointConnections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRejectVpcPeeringConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RejectVpcPeeringConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReleaseAddressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReleaseAddress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReleaseHostsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReleaseHosts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReleaseIpamPoolAllocationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReleaseIpamPoolAllocation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReplaceIamInstanceProfileAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReplaceIamInstanceProfileAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReplaceImageCriteriaInAllowedImagesSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReplaceImageCriteriaInAllowedImagesSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReplaceNetworkAclAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReplaceNetworkAclAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReplaceNetworkAclEntrySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReplaceNetworkAclEntry(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReplaceRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReplaceRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReplaceRouteTableAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReplaceRouteTableAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReplaceTransitGatewayRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReplaceTransitGatewayRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReplaceVpnTunnelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReplaceVpnTunnel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReportInstanceStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReportInstanceStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRequestSpotFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RequestSpotFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRequestSpotInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RequestSpotInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetAddressAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetAddressAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetEbsDefaultKmsKeyIdSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetEbsDefaultKmsKeyId(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetFpgaImageAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetFpgaImageAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetImageAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetImageAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetInstanceAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetInstanceAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetNetworkInterfaceAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetNetworkInterfaceAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetSnapshotAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetSnapshotAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreAddressToClassicSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreAddressToClassic(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreImageFromRecycleBinSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreImageFromRecycleBin(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreManagedPrefixListVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreManagedPrefixListVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreSnapshotFromRecycleBinSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreSnapshotFromRecycleBin(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreSnapshotTierSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreSnapshotTier(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRevokeClientVpnIngressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RevokeClientVpnIngress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRevokeSecurityGroupEgressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RevokeSecurityGroupEgress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRevokeSecurityGroupIngressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RevokeSecurityGroupIngress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRunInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RunInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRunScheduledInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RunScheduledInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchLocalGatewayRoutesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchLocalGatewayRoutes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchTransitGatewayMulticastGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchTransitGatewayMulticastGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchTransitGatewayRoutesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchTransitGatewayRoutes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendDiagnosticInterruptSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendDiagnosticInterrupt(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDeclarativePoliciesReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDeclarativePoliciesReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartNetworkInsightsAccessScopeAnalysisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartNetworkInsightsAccessScopeAnalysis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartNetworkInsightsAnalysisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartNetworkInsightsAnalysis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartVpcEndpointServicePrivateDnsVerificationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartVpcEndpointServicePrivateDnsVerification(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTerminateClientVpnConnectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TerminateClientVpnConnections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTerminateInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TerminateInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUnassignIpv6AddressesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UnassignIpv6Addresses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUnassignPrivateIpAddressesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UnassignPrivateIpAddresses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUnassignPrivateNatGatewayAddressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UnassignPrivateNatGatewayAddress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUnlockSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UnlockSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUnmonitorInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UnmonitorInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSecurityGroupRuleDescriptionsEgressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSecurityGroupRuleDescriptionsEgress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSecurityGroupRuleDescriptionsIngressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSecurityGroupRuleDescriptionsIngress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpWithdrawByoipCidrSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.WithdrawByoipCidr(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/ec2instanceconnect/generated.json b/service/ec2instanceconnect/generated.json index 6a77ac10bdb..f5e90423943 100644 --- a/service/ec2instanceconnect/generated.json +++ b/service/ec2instanceconnect/generated.json @@ -23,6 +23,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/errors.go", "types/types.go", "validators.go" diff --git a/service/ec2instanceconnect/sra_operation_order_test.go b/service/ec2instanceconnect/sra_operation_order_test.go new file mode 100644 index 00000000000..04b2af54308 --- /dev/null +++ b/service/ec2instanceconnect/sra_operation_order_test.go @@ -0,0 +1,91 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ec2instanceconnect + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpSendSerialConsoleSSHPublicKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendSerialConsoleSSHPublicKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendSSHPublicKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendSSHPublicKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/ecr/generated.json b/service/ecr/generated.json index 98af9d4342b..e9160421d9e 100644 --- a/service/ecr/generated.json +++ b/service/ecr/generated.json @@ -70,6 +70,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/ecr/sra_operation_order_test.go b/service/ecr/sra_operation_order_test.go new file mode 100644 index 00000000000..7343d6f7651 --- /dev/null +++ b/service/ecr/sra_operation_order_test.go @@ -0,0 +1,1736 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ecr + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchCheckLayerAvailabilitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchCheckLayerAvailability(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeleteImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetRepositoryScanningConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetRepositoryScanningConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCompleteLayerUploadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CompleteLayerUpload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePullThroughCacheRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePullThroughCacheRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRepositorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRepository(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRepositoryCreationTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRepositoryCreationTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLifecyclePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLifecyclePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePullThroughCacheRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePullThroughCacheRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRegistryPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRegistryPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRepositorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRepository(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRepositoryCreationTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRepositoryCreationTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRepositoryPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRepositoryPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeImageReplicationStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeImageReplicationStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeImagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeImages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeImageScanFindingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeImageScanFindings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePullThroughCacheRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePullThroughCacheRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRegistrySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRegistry(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRepositoriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRepositories(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRepositoryCreationTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRepositoryCreationTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccountSettingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccountSetting(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAuthorizationTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAuthorizationToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDownloadUrlForLayerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDownloadUrlForLayer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLifecyclePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLifecyclePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLifecyclePolicyPreviewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLifecyclePolicyPreview(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRegistryPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRegistryPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRegistryScanningConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRegistryScanningConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRepositoryPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRepositoryPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInitiateLayerUploadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InitiateLayerUpload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListImagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListImages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAccountSettingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAccountSetting(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutImageScanningConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutImageScanningConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutImageTagMutabilitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutImageTagMutability(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutLifecyclePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutLifecyclePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRegistryPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRegistryPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRegistryScanningConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRegistryScanningConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutReplicationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutReplicationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetRepositoryPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetRepositoryPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartImageScanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartImageScan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartLifecyclePolicyPreviewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartLifecyclePolicyPreview(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePullThroughCacheRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePullThroughCacheRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRepositoryCreationTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRepositoryCreationTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUploadLayerPartSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UploadLayerPart(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpValidatePullThroughCacheRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ValidatePullThroughCacheRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/ecrpublic/generated.json b/service/ecrpublic/generated.json index 579ca2c1266..04e54760c03 100644 --- a/service/ecrpublic/generated.json +++ b/service/ecrpublic/generated.json @@ -44,6 +44,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/ecrpublic/sra_operation_order_test.go b/service/ecrpublic/sra_operation_order_test.go new file mode 100644 index 00000000000..68db234b9a5 --- /dev/null +++ b/service/ecrpublic/sra_operation_order_test.go @@ -0,0 +1,826 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ecrpublic + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchCheckLayerAvailabilitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchCheckLayerAvailability(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeleteImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCompleteLayerUploadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CompleteLayerUpload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRepositorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRepository(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRepositorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRepository(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRepositoryPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRepositoryPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeImagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeImages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeImageTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeImageTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRegistriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRegistries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRepositoriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRepositories(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAuthorizationTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAuthorizationToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRegistryCatalogDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRegistryCatalogData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRepositoryCatalogDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRepositoryCatalogData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRepositoryPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRepositoryPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInitiateLayerUploadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InitiateLayerUpload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRegistryCatalogDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRegistryCatalogData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRepositoryCatalogDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRepositoryCatalogData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetRepositoryPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetRepositoryPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUploadLayerPartSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UploadLayerPart(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/ecs/generated.json b/service/ecs/generated.json index 0dd8a32fd2e..ad02dd3d4f9 100644 --- a/service/ecs/generated.json +++ b/service/ecs/generated.json @@ -80,6 +80,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/ecs/sra_operation_order_test.go b/service/ecs/sra_operation_order_test.go new file mode 100644 index 00000000000..36497bb696e --- /dev/null +++ b/service/ecs/sra_operation_order_test.go @@ -0,0 +1,2086 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ecs + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateCapacityProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCapacityProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTaskSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTaskSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccountSettingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccountSetting(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCapacityProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCapacityProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTaskDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTaskDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTaskSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTaskSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterContainerInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterContainerInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterTaskDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterTaskDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCapacityProvidersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCapacityProviders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeContainerInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeContainerInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeServiceDeploymentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeServiceDeployments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeServiceRevisionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeServiceRevisions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeServicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeServices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTaskDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTaskDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTaskSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTaskSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDiscoverPollEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DiscoverPollEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExecuteCommandSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExecuteCommand(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTaskProtectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTaskProtection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccountSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccountSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListContainerInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListContainerInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServiceDeploymentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServiceDeployments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServicesByNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServicesByNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTaskDefinitionFamiliesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTaskDefinitionFamilies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTaskDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTaskDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAccountSettingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAccountSetting(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAccountSettingDefaultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAccountSettingDefault(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutClusterCapacityProvidersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutClusterCapacityProviders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterContainerInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterContainerInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterTaskDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterTaskDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRunTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RunTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSubmitAttachmentStateChangesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SubmitAttachmentStateChanges(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSubmitContainerStateChangeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SubmitContainerStateChange(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSubmitTaskStateChangeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SubmitTaskStateChange(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCapacityProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCapacityProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateClusterSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateClusterSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateContainerAgentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateContainerAgent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateContainerInstancesStateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateContainerInstancesState(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateServicePrimaryTaskSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateServicePrimaryTaskSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTaskProtectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTaskProtection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTaskSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTaskSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/efs/generated.json b/service/efs/generated.json index d47d2b38921..8dbb910b3d1 100644 --- a/service/efs/generated.json +++ b/service/efs/generated.json @@ -52,6 +52,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/efs/sra_operation_order_test.go b/service/efs/sra_operation_order_test.go new file mode 100644 index 00000000000..89639549209 --- /dev/null +++ b/service/efs/sra_operation_order_test.go @@ -0,0 +1,1106 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package efs + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateAccessPointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAccessPoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFileSystemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFileSystem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMountTargetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMountTarget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateReplicationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateReplicationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccessPointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccessPoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFileSystemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFileSystem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFileSystemPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFileSystemPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMountTargetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMountTarget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteReplicationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteReplicationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccessPointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccessPoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccountPreferencesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccountPreferences(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBackupPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBackupPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFileSystemPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFileSystemPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFileSystemsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFileSystems(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLifecycleConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLifecycleConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMountTargetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMountTargets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMountTargetSecurityGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMountTargetSecurityGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReplicationConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReplicationConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyMountTargetSecurityGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyMountTargetSecurityGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAccountPreferencesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAccountPreferences(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBackupPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBackupPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutFileSystemPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutFileSystemPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutLifecycleConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutLifecycleConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFileSystemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFileSystem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFileSystemProtectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFileSystemProtection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/eks/generated.json b/service/eks/generated.json index 044a2bd381a..a2b562703e6 100644 --- a/service/eks/generated.json +++ b/service/eks/generated.json @@ -78,6 +78,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/eks/sra_operation_order_test.go b/service/eks/sra_operation_order_test.go new file mode 100644 index 00000000000..065467083e9 --- /dev/null +++ b/service/eks/sra_operation_order_test.go @@ -0,0 +1,2016 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package eks + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateAccessPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateAccessPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateEncryptionConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateEncryptionConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateIdentityProviderConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateIdentityProviderConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAccessEntrySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAccessEntry(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAddonSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAddon(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEksAnywhereSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEksAnywhereSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFargateProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFargateProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateNodegroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNodegroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePodIdentityAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePodIdentityAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccessEntrySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccessEntry(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAddonSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAddon(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEksAnywhereSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEksAnywhereSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFargateProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFargateProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNodegroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNodegroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePodIdentityAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePodIdentityAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccessEntrySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccessEntry(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAddonSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAddon(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAddonConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAddonConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAddonVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAddonVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClusterVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeClusterVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEksAnywhereSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEksAnywhereSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFargateProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFargateProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIdentityProviderConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIdentityProviderConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInsightSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInsight(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeNodegroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeNodegroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePodIdentityAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePodIdentityAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeUpdateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeUpdate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateAccessPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateAccessPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateIdentityProviderConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateIdentityProviderConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccessEntriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccessEntries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccessPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccessPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAddonsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAddons(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssociatedAccessPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssociatedAccessPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEksAnywhereSubscriptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEksAnywhereSubscriptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFargateProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFargateProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIdentityProviderConfigsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIdentityProviderConfigs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInsightsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInsights(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNodegroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNodegroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPodIdentityAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPodIdentityAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUpdatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUpdates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAccessEntrySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAccessEntry(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAddonSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAddon(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateClusterConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateClusterConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateClusterVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateClusterVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEksAnywhereSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEksAnywhereSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateNodegroupConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateNodegroupConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateNodegroupVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateNodegroupVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePodIdentityAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePodIdentityAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/eksauth/generated.json b/service/eksauth/generated.json index fa1fabf910a..5bed3a98267 100644 --- a/service/eksauth/generated.json +++ b/service/eksauth/generated.json @@ -22,6 +22,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/errors.go", "types/types.go", "validators.go" diff --git a/service/eksauth/sra_operation_order_test.go b/service/eksauth/sra_operation_order_test.go new file mode 100644 index 00000000000..2a59e3aec3f --- /dev/null +++ b/service/eksauth/sra_operation_order_test.go @@ -0,0 +1,56 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package eksauth + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssumeRoleForPodIdentitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssumeRoleForPodIdentity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/elasticache/generated.json b/service/elasticache/generated.json index dd7ca825ff3..dd1378dc5a2 100644 --- a/service/elasticache/generated.json +++ b/service/elasticache/generated.json @@ -96,6 +96,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/elasticache/sra_operation_order_test.go b/service/elasticache/sra_operation_order_test.go new file mode 100644 index 00000000000..5a2b7db3e8e --- /dev/null +++ b/service/elasticache/sra_operation_order_test.go @@ -0,0 +1,2646 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticache + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddTagsToResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddTagsToResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAuthorizeCacheSecurityGroupIngressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AuthorizeCacheSecurityGroupIngress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchApplyUpdateActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchApplyUpdateAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchStopUpdateActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchStopUpdateAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCompleteMigrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CompleteMigration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCopyServerlessCacheSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopyServerlessCacheSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCopySnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopySnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCacheClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCacheCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCacheParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCacheParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCacheSecurityGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCacheSecurityGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCacheSubnetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCacheSubnetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGlobalReplicationGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGlobalReplicationGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateReplicationGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateReplicationGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateServerlessCacheSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateServerlessCache(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateServerlessCacheSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateServerlessCacheSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUserGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUserGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDecreaseNodeGroupsInGlobalReplicationGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DecreaseNodeGroupsInGlobalReplicationGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDecreaseReplicaCountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DecreaseReplicaCount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCacheClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCacheCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCacheParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCacheParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCacheSecurityGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCacheSecurityGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCacheSubnetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCacheSubnetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGlobalReplicationGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGlobalReplicationGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteReplicationGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteReplicationGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteServerlessCacheSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteServerlessCache(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteServerlessCacheSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteServerlessCacheSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUserGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCacheClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCacheClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCacheEngineVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCacheEngineVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCacheParameterGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCacheParameterGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCacheParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCacheParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCacheSecurityGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCacheSecurityGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCacheSubnetGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCacheSubnetGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEngineDefaultParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEngineDefaultParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGlobalReplicationGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGlobalReplicationGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReplicationGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReplicationGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReservedCacheNodesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReservedCacheNodes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReservedCacheNodesOfferingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReservedCacheNodesOfferings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeServerlessCachesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeServerlessCaches(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeServerlessCacheSnapshotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeServerlessCacheSnapshots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeServiceUpdatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeServiceUpdates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSnapshotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSnapshots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeUpdateActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeUpdateActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeUserGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeUserGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeUsersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeUsers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateGlobalReplicationGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateGlobalReplicationGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportServerlessCacheSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportServerlessCacheSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpFailoverGlobalReplicationGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.FailoverGlobalReplicationGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpIncreaseNodeGroupsInGlobalReplicationGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.IncreaseNodeGroupsInGlobalReplicationGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpIncreaseReplicaCountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.IncreaseReplicaCount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAllowedNodeTypeModificationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAllowedNodeTypeModifications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyCacheClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyCacheCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyCacheParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyCacheParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyCacheSubnetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyCacheSubnetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyGlobalReplicationGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyGlobalReplicationGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyReplicationGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyReplicationGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyReplicationGroupShardConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyReplicationGroupShardConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyServerlessCacheSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyServerlessCache(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyUserGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyUserGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPurchaseReservedCacheNodesOfferingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PurchaseReservedCacheNodesOffering(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRebalanceSlotsInGlobalReplicationGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RebalanceSlotsInGlobalReplicationGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRebootCacheClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RebootCacheCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveTagsFromResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveTagsFromResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetCacheParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetCacheParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRevokeCacheSecurityGroupIngressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RevokeCacheSecurityGroupIngress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMigrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMigration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestFailoverSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestFailover(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestMigrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestMigration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/elasticbeanstalk/generated.json b/service/elasticbeanstalk/generated.json index 51dd3b9ece9..c1a2bb613c0 100644 --- a/service/elasticbeanstalk/generated.json +++ b/service/elasticbeanstalk/generated.json @@ -68,6 +68,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/elasticbeanstalk/sra_operation_order_test.go b/service/elasticbeanstalk/sra_operation_order_test.go new file mode 100644 index 00000000000..b4b317b8d60 --- /dev/null +++ b/service/elasticbeanstalk/sra_operation_order_test.go @@ -0,0 +1,1666 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticbeanstalk + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAbortEnvironmentUpdateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AbortEnvironmentUpdate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpApplyEnvironmentManagedActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ApplyEnvironmentManagedAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateEnvironmentOperationsRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateEnvironmentOperationsRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCheckDNSAvailabilitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CheckDNSAvailability(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpComposeEnvironmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ComposeEnvironments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateApplicationVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApplicationVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConfigurationTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConfigurationTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePlatformVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePlatformVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStorageLocationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStorageLocation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplicationVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConfigurationTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConfigurationTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEnvironmentConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEnvironmentConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePlatformVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePlatformVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccountAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccountAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeApplicationVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeApplicationVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConfigurationOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConfigurationOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConfigurationSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConfigurationSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEnvironmentHealthSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEnvironmentHealth(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEnvironmentManagedActionHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEnvironmentManagedActionHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEnvironmentManagedActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEnvironmentManagedActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEnvironmentResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEnvironmentResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEnvironmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEnvironments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInstancesHealthSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInstancesHealth(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePlatformVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePlatformVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateEnvironmentOperationsRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateEnvironmentOperationsRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAvailableSolutionStacksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAvailableSolutionStacks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPlatformBranchesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPlatformBranches(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPlatformVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPlatformVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRebuildEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RebuildEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRequestEnvironmentInfoSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RequestEnvironmentInfo(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestartAppServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestartAppServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRetrieveEnvironmentInfoSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RetrieveEnvironmentInfo(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSwapEnvironmentCNAMEsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SwapEnvironmentCNAMEs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTerminateEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TerminateEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApplicationResourceLifecycleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApplicationResourceLifecycle(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApplicationVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApplicationVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConfigurationTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConfigurationTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpValidateConfigurationSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ValidateConfigurationSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/elasticloadbalancing/generated.json b/service/elasticloadbalancing/generated.json index 7d629080f68..696c020fccb 100644 --- a/service/elasticloadbalancing/generated.json +++ b/service/elasticloadbalancing/generated.json @@ -50,6 +50,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/errors.go", "types/types.go", "validators.go" diff --git a/service/elasticloadbalancing/sra_operation_order_test.go b/service/elasticloadbalancing/sra_operation_order_test.go new file mode 100644 index 00000000000..77cb542f4f5 --- /dev/null +++ b/service/elasticloadbalancing/sra_operation_order_test.go @@ -0,0 +1,1036 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancing + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpApplySecurityGroupsToLoadBalancerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ApplySecurityGroupsToLoadBalancer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachLoadBalancerToSubnetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachLoadBalancerToSubnets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpConfigureHealthCheckSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ConfigureHealthCheck(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAppCookieStickinessPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAppCookieStickinessPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLBCookieStickinessPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLBCookieStickinessPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLoadBalancerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLoadBalancer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLoadBalancerListenersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLoadBalancerListeners(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLoadBalancerPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLoadBalancerPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLoadBalancerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLoadBalancer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLoadBalancerListenersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLoadBalancerListeners(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLoadBalancerPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLoadBalancerPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterInstancesFromLoadBalancerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterInstancesFromLoadBalancer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccountLimitsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccountLimits(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInstanceHealthSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInstanceHealth(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLoadBalancerAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLoadBalancerAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLoadBalancerPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLoadBalancerPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLoadBalancerPolicyTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLoadBalancerPolicyTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLoadBalancersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLoadBalancers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachLoadBalancerFromSubnetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachLoadBalancerFromSubnets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableAvailabilityZonesForLoadBalancerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableAvailabilityZonesForLoadBalancer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableAvailabilityZonesForLoadBalancerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableAvailabilityZonesForLoadBalancer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyLoadBalancerAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyLoadBalancerAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterInstancesWithLoadBalancerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterInstancesWithLoadBalancer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetLoadBalancerListenerSSLCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetLoadBalancerListenerSSLCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetLoadBalancerPoliciesForBackendServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetLoadBalancerPoliciesForBackendServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetLoadBalancerPoliciesOfListenerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetLoadBalancerPoliciesOfListener(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/elasticloadbalancingv2/generated.json b/service/elasticloadbalancingv2/generated.json index 96b42cabaea..f9e32db7058 100644 --- a/service/elasticloadbalancingv2/generated.json +++ b/service/elasticloadbalancingv2/generated.json @@ -71,6 +71,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/elasticloadbalancingv2/sra_operation_order_test.go b/service/elasticloadbalancingv2/sra_operation_order_test.go new file mode 100644 index 00000000000..3a9b2b92b43 --- /dev/null +++ b/service/elasticloadbalancingv2/sra_operation_order_test.go @@ -0,0 +1,1771 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticloadbalancingv2 + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddListenerCertificatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddListenerCertificates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddTrustStoreRevocationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddTrustStoreRevocations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateListenerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateListener(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLoadBalancerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLoadBalancer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTargetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTargetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTrustStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTrustStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteListenerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteListener(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLoadBalancerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLoadBalancer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSharedTrustStoreAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSharedTrustStoreAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTargetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTargetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTrustStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTrustStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterTargetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterTargets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccountLimitsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccountLimits(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCapacityReservationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCapacityReservation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeListenerAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeListenerAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeListenerCertificatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeListenerCertificates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeListenersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeListeners(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLoadBalancerAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLoadBalancerAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLoadBalancersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLoadBalancers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSSLPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSSLPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTargetGroupAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTargetGroupAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTargetGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTargetGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTargetHealthSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTargetHealth(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTrustStoreAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTrustStoreAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTrustStoreRevocationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTrustStoreRevocations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTrustStoresSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTrustStores(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTrustStoreCaCertificatesBundleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTrustStoreCaCertificatesBundle(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTrustStoreRevocationContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTrustStoreRevocationContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyCapacityReservationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyCapacityReservation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyListenerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyListener(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyListenerAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyListenerAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyLoadBalancerAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyLoadBalancerAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyTargetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyTargetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyTargetGroupAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyTargetGroupAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyTrustStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyTrustStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterTargetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterTargets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveListenerCertificatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveListenerCertificates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveTrustStoreRevocationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveTrustStoreRevocations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetIpAddressTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetIpAddressType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetRulePrioritiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetRulePriorities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetSecurityGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetSecurityGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetSubnetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetSubnets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/elasticsearchservice/generated.json b/service/elasticsearchservice/generated.json index f2d92941668..96bab217c6a 100644 --- a/service/elasticsearchservice/generated.json +++ b/service/elasticsearchservice/generated.json @@ -72,6 +72,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/elasticsearchservice/sra_operation_order_test.go b/service/elasticsearchservice/sra_operation_order_test.go new file mode 100644 index 00000000000..9e36e16f509 --- /dev/null +++ b/service/elasticsearchservice/sra_operation_order_test.go @@ -0,0 +1,1806 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elasticsearchservice + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcceptInboundCrossClusterSearchConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptInboundCrossClusterSearchConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociatePackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociatePackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAuthorizeVpcEndpointAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AuthorizeVpcEndpointAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelDomainConfigChangeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelDomainConfigChange(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelElasticsearchServiceSoftwareUpdateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelElasticsearchServiceSoftwareUpdate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateElasticsearchDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateElasticsearchDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateOutboundCrossClusterSearchConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateOutboundCrossClusterSearchConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVpcEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVpcEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteElasticsearchDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteElasticsearchDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteElasticsearchServiceRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteElasticsearchServiceRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInboundCrossClusterSearchConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInboundCrossClusterSearchConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteOutboundCrossClusterSearchConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteOutboundCrossClusterSearchConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVpcEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVpcEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDomainAutoTunesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDomainAutoTunes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDomainChangeProgressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDomainChangeProgress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeElasticsearchDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeElasticsearchDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeElasticsearchDomainConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeElasticsearchDomainConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeElasticsearchDomainsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeElasticsearchDomains(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeElasticsearchInstanceTypeLimitsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeElasticsearchInstanceTypeLimits(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInboundCrossClusterSearchConnectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInboundCrossClusterSearchConnections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOutboundCrossClusterSearchConnectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOutboundCrossClusterSearchConnections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePackagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePackages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReservedElasticsearchInstanceOfferingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReservedElasticsearchInstanceOfferings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReservedElasticsearchInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReservedElasticsearchInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVpcEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVpcEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDissociatePackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DissociatePackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCompatibleElasticsearchVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCompatibleElasticsearchVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPackageVersionHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPackageVersionHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUpgradeHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUpgradeHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUpgradeStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUpgradeStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDomainNamesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDomainNames(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDomainsForPackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDomainsForPackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListElasticsearchInstanceTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListElasticsearchInstanceTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListElasticsearchVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListElasticsearchVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPackagesForDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPackagesForDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVpcEndpointAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVpcEndpointAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVpcEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVpcEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVpcEndpointsForDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVpcEndpointsForDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPurchaseReservedElasticsearchInstanceOfferingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PurchaseReservedElasticsearchInstanceOffering(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRejectInboundCrossClusterSearchConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RejectInboundCrossClusterSearchConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRevokeVpcEndpointAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RevokeVpcEndpointAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartElasticsearchServiceSoftwareUpdateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartElasticsearchServiceSoftwareUpdate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateElasticsearchDomainConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateElasticsearchDomainConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVpcEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVpcEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpgradeElasticsearchDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpgradeElasticsearchDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/elastictranscoder/generated.json b/service/elastictranscoder/generated.json index 9a8846da4b7..3d46d19d9db 100644 --- a/service/elastictranscoder/generated.json +++ b/service/elastictranscoder/generated.json @@ -38,6 +38,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/errors.go", "types/types.go", "validators.go" diff --git a/service/elastictranscoder/sra_operation_order_test.go b/service/elastictranscoder/sra_operation_order_test.go new file mode 100644 index 00000000000..9e4ee967b8f --- /dev/null +++ b/service/elastictranscoder/sra_operation_order_test.go @@ -0,0 +1,616 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package elastictranscoder + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCancelJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePresetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePreset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePresetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePreset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJobsByPipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJobsByPipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJobsByStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJobsByStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPipelinesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPipelines(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPresetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPresets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReadJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReadJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReadPipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReadPipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReadPresetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReadPreset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePipelineNotificationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePipelineNotifications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePipelineStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePipelineStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/emr/generated.json b/service/emr/generated.json index f0fccce4d83..ed2c01d358c 100644 --- a/service/emr/generated.json +++ b/service/emr/generated.json @@ -77,6 +77,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/emr/sra_operation_order_test.go b/service/emr/sra_operation_order_test.go new file mode 100644 index 00000000000..40990517adc --- /dev/null +++ b/service/emr/sra_operation_order_test.go @@ -0,0 +1,1981 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package emr + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddInstanceFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddInstanceFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddInstanceGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddInstanceGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddJobFlowStepsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddJobFlowSteps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelStepsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelSteps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSecurityConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSecurityConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStudioSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStudio(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStudioSessionMappingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStudioSessionMapping(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSecurityConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSecurityConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteStudioSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteStudio(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteStudioSessionMappingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteStudioSessionMapping(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeJobFlowsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeJobFlows(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeNotebookExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeNotebookExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReleaseLabelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReleaseLabel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSecurityConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSecurityConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStepSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStep(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStudioSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStudio(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAutoTerminationPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAutoTerminationPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBlockPublicAccessConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBlockPublicAccessConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetClusterSessionCredentialsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetClusterSessionCredentials(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetManagedScalingPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetManagedScalingPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStudioSessionMappingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStudioSessionMapping(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBootstrapActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBootstrapActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInstanceFleetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInstanceFleets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInstanceGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInstanceGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNotebookExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNotebookExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReleaseLabelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReleaseLabels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSecurityConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSecurityConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStepsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSteps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStudiosSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStudios(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStudioSessionMappingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStudioSessionMappings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSupportedInstanceTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSupportedInstanceTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyInstanceFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyInstanceFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyInstanceGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyInstanceGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAutoScalingPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAutoScalingPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAutoTerminationPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAutoTerminationPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBlockPublicAccessConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBlockPublicAccessConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutManagedScalingPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutManagedScalingPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveAutoScalingPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveAutoScalingPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveAutoTerminationPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveAutoTerminationPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveManagedScalingPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveManagedScalingPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRunJobFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RunJobFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetKeepJobFlowAliveWhenNoStepsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetKeepJobFlowAliveWhenNoSteps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetTerminationProtectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetTerminationProtection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetUnhealthyNodeReplacementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetUnhealthyNodeReplacement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetVisibleToAllUsersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetVisibleToAllUsers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartNotebookExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartNotebookExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopNotebookExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopNotebookExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTerminateJobFlowsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TerminateJobFlows(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateStudioSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateStudio(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateStudioSessionMappingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateStudioSessionMapping(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/emrcontainers/generated.json b/service/emrcontainers/generated.json index bfd87ea7be8..ff8f658b05d 100644 --- a/service/emrcontainers/generated.json +++ b/service/emrcontainers/generated.json @@ -44,6 +44,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/emrcontainers/sra_operation_order_test.go b/service/emrcontainers/sra_operation_order_test.go new file mode 100644 index 00000000000..9702576d2c5 --- /dev/null +++ b/service/emrcontainers/sra_operation_order_test.go @@ -0,0 +1,826 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package emrcontainers + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCancelJobRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelJobRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateJobTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateJobTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateManagedEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateManagedEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSecurityConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSecurityConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVirtualClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVirtualCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteJobTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteJobTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteManagedEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteManagedEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVirtualClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVirtualCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeJobRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeJobRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeJobTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeJobTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeManagedEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeManagedEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSecurityConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSecurityConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVirtualClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVirtualCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetManagedEndpointSessionCredentialsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetManagedEndpointSessionCredentials(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJobRunsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJobRuns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJobTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJobTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListManagedEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListManagedEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSecurityConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSecurityConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVirtualClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVirtualClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartJobRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartJobRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/emrserverless/generated.json b/service/emrserverless/generated.json index 9dcd08cda26..619d47ab623 100644 --- a/service/emrserverless/generated.json +++ b/service/emrserverless/generated.json @@ -37,6 +37,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/emrserverless/sra_operation_order_test.go b/service/emrserverless/sra_operation_order_test.go new file mode 100644 index 00000000000..418fbf46c70 --- /dev/null +++ b/service/emrserverless/sra_operation_order_test.go @@ -0,0 +1,581 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package emrserverless + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCancelJobRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelJobRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDashboardForJobRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDashboardForJobRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetJobRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetJobRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJobRunAttemptsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJobRunAttempts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJobRunsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJobRuns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartJobRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartJobRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/entityresolution/generated.json b/service/entityresolution/generated.json index ec00d12a59c..befd07c2df6 100644 --- a/service/entityresolution/generated.json +++ b/service/entityresolution/generated.json @@ -62,6 +62,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/entityresolution/sra_operation_order_test.go b/service/entityresolution/sra_operation_order_test.go new file mode 100644 index 00000000000..04e44686870 --- /dev/null +++ b/service/entityresolution/sra_operation_order_test.go @@ -0,0 +1,1316 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package entityresolution + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddPolicyStatementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddPolicyStatement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeleteUniqueIdSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteUniqueId(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIdMappingWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIdMappingWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIdNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIdNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMatchingWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMatchingWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSchemaMappingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSchemaMapping(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIdMappingWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIdMappingWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIdNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIdNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMatchingWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMatchingWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePolicyStatementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePolicyStatement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSchemaMappingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSchemaMapping(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIdMappingJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIdMappingJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIdMappingWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIdMappingWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIdNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIdNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMatchIdSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMatchId(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMatchingJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMatchingJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMatchingWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMatchingWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetProviderServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetProviderService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSchemaMappingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSchemaMapping(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIdMappingJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIdMappingJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIdMappingWorkflowsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIdMappingWorkflows(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIdNamespacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIdNamespaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMatchingJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMatchingJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMatchingWorkflowsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMatchingWorkflows(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProviderServicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProviderServices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSchemaMappingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSchemaMappings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartIdMappingJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartIdMappingJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMatchingJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMatchingJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIdMappingWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIdMappingWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIdNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIdNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMatchingWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMatchingWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSchemaMappingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSchemaMapping(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/eventbridge/generated.json b/service/eventbridge/generated.json index 53dd2b0d545..6d762da4e59 100644 --- a/service/eventbridge/generated.json +++ b/service/eventbridge/generated.json @@ -79,6 +79,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/eventbridge/sra_operation_order_test.go b/service/eventbridge/sra_operation_order_test.go new file mode 100644 index 00000000000..f185bd5322f --- /dev/null +++ b/service/eventbridge/sra_operation_order_test.go @@ -0,0 +1,2016 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package eventbridge + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpActivateEventSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ActivateEventSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelReplaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelReplay(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateApiDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApiDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateArchiveSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateArchive(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEventBusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEventBus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePartnerEventSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePartnerEventSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeactivateEventSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeactivateEventSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeauthorizeConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeauthorizeConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApiDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApiDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteArchiveSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteArchive(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEventBusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEventBus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePartnerEventSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePartnerEventSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeApiDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeApiDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeArchiveSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeArchive(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventBusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEventBus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEventSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePartnerEventSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePartnerEventSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReplaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReplay(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApiDestinationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApiDestinations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListArchivesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListArchives(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConnectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConnections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEventBusesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEventBuses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEventSourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEventSources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPartnerEventSourceAccountsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPartnerEventSourceAccounts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPartnerEventSourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPartnerEventSources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReplaysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReplays(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRuleNamesByTargetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRuleNamesByTarget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTargetsByRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTargetsByRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutPartnerEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutPartnerEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutPermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutPermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutTargetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutTargets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemovePermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemovePermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveTargetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveTargets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartReplaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartReplay(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestEventPatternSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestEventPattern(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApiDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApiDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateArchiveSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateArchive(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEventBusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEventBus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/evidently/generated.json b/service/evidently/generated.json index 2d6e20b52ad..f969f944ec1 100644 --- a/service/evidently/generated.json +++ b/service/evidently/generated.json @@ -59,6 +59,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/evidently/sra_operation_order_test.go b/service/evidently/sra_operation_order_test.go new file mode 100644 index 00000000000..e9ac04aa979 --- /dev/null +++ b/service/evidently/sra_operation_order_test.go @@ -0,0 +1,1351 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package evidently + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchEvaluateFeatureSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchEvaluateFeature(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateExperimentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateExperiment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFeatureSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFeature(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLaunchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLaunch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSegmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSegment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteExperimentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteExperiment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFeatureSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFeature(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLaunchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLaunch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSegmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSegment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEvaluateFeatureSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EvaluateFeature(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetExperimentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetExperiment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetExperimentResultsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetExperimentResults(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFeatureSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFeature(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLaunchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLaunch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSegmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSegment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListExperimentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListExperiments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFeaturesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFeatures(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLaunchesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLaunches(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProjectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProjects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSegmentReferencesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSegmentReferences(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSegmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSegments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutProjectEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutProjectEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartExperimentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartExperiment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartLaunchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartLaunch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopExperimentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopExperiment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopLaunchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopLaunch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestSegmentPatternSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestSegmentPattern(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateExperimentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateExperiment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFeatureSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFeature(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLaunchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLaunch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProjectDataDeliverySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProjectDataDelivery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/finspace/generated.json b/service/finspace/generated.json index 373b7362739..480b5ec3bfb 100644 --- a/service/finspace/generated.json +++ b/service/finspace/generated.json @@ -71,6 +71,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/finspace/sra_operation_order_test.go b/service/finspace/sra_operation_order_test.go new file mode 100644 index 00000000000..1cb43597007 --- /dev/null +++ b/service/finspace/sra_operation_order_test.go @@ -0,0 +1,1771 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package finspace + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateKxChangesetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateKxChangeset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateKxClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateKxCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateKxDatabaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateKxDatabase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateKxDataviewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateKxDataview(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateKxEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateKxEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateKxScalingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateKxScalingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateKxUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateKxUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateKxVolumeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateKxVolume(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteKxClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteKxCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteKxClusterNodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteKxClusterNode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteKxDatabaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteKxDatabase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteKxDataviewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteKxDataview(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteKxEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteKxEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteKxScalingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteKxScalingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteKxUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteKxUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteKxVolumeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteKxVolume(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetKxChangesetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetKxChangeset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetKxClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetKxCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetKxConnectionStringSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetKxConnectionString(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetKxDatabaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetKxDatabase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetKxDataviewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetKxDataview(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetKxEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetKxEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetKxScalingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetKxScalingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetKxUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetKxUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetKxVolumeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetKxVolume(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEnvironmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEnvironments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListKxChangesetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListKxChangesets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListKxClusterNodesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListKxClusterNodes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListKxClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListKxClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListKxDatabasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListKxDatabases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListKxDataviewsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListKxDataviews(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListKxEnvironmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListKxEnvironments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListKxScalingGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListKxScalingGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListKxUsersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListKxUsers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListKxVolumesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListKxVolumes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateKxClusterCodeConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateKxClusterCodeConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateKxClusterDatabasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateKxClusterDatabases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateKxDatabaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateKxDatabase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateKxDataviewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateKxDataview(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateKxEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateKxEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateKxEnvironmentNetworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateKxEnvironmentNetwork(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateKxUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateKxUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateKxVolumeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateKxVolume(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/finspacedata/generated.json b/service/finspacedata/generated.json index 06e30165b9d..b1ce69b5175 100644 --- a/service/finspacedata/generated.json +++ b/service/finspacedata/generated.json @@ -52,6 +52,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/finspacedata/sra_operation_order_test.go b/service/finspacedata/sra_operation_order_test.go new file mode 100644 index 00000000000..f378722644d --- /dev/null +++ b/service/finspacedata/sra_operation_order_test.go @@ -0,0 +1,1106 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package finspacedata + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateUserToPermissionGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateUserToPermissionGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateChangesetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateChangeset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataViewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataView(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePermissionGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePermissionGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePermissionGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePermissionGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateUserFromPermissionGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateUserFromPermissionGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetChangesetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetChangeset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataViewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataView(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetExternalDataViewAccessDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetExternalDataViewAccessDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPermissionGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPermissionGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetProgrammaticAccessCredentialsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetProgrammaticAccessCredentials(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWorkingLocationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWorkingLocation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListChangesetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListChangesets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDatasetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDatasets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataViewsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataViews(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPermissionGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPermissionGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPermissionGroupsByUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPermissionGroupsByUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUsersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUsers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUsersByPermissionGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUsersByPermissionGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetUserPasswordSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetUserPassword(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateChangesetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateChangeset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePermissionGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePermissionGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/firehose/generated.json b/service/firehose/generated.json index 0520863f937..99da0b9d1ba 100644 --- a/service/firehose/generated.json +++ b/service/firehose/generated.json @@ -33,6 +33,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/firehose/sra_operation_order_test.go b/service/firehose/sra_operation_order_test.go new file mode 100644 index 00000000000..7c9216f5396 --- /dev/null +++ b/service/firehose/sra_operation_order_test.go @@ -0,0 +1,441 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package firehose + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateDeliveryStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDeliveryStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDeliveryStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDeliveryStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDeliveryStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDeliveryStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDeliveryStreamsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDeliveryStreams(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForDeliveryStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForDeliveryStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRecordSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRecord(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRecordBatchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRecordBatch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDeliveryStreamEncryptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDeliveryStreamEncryption(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopDeliveryStreamEncryptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopDeliveryStreamEncryption(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagDeliveryStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagDeliveryStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagDeliveryStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagDeliveryStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/fis/generated.json b/service/fis/generated.json index d5e3d0887ec..c89d4517f94 100644 --- a/service/fis/generated.json +++ b/service/fis/generated.json @@ -47,6 +47,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/fis/sra_operation_order_test.go b/service/fis/sra_operation_order_test.go new file mode 100644 index 00000000000..fc14ce86d96 --- /dev/null +++ b/service/fis/sra_operation_order_test.go @@ -0,0 +1,931 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package fis + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateExperimentTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateExperimentTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTargetAccountConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTargetAccountConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteExperimentTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteExperimentTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTargetAccountConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTargetAccountConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetExperimentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetExperiment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetExperimentTargetAccountConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetExperimentTargetAccountConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetExperimentTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetExperimentTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSafetyLeverSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSafetyLever(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTargetAccountConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTargetAccountConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTargetResourceTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTargetResourceType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListExperimentResolvedTargetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListExperimentResolvedTargets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListExperimentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListExperiments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListExperimentTargetAccountConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListExperimentTargetAccountConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListExperimentTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListExperimentTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTargetAccountConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTargetAccountConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTargetResourceTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTargetResourceTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartExperimentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartExperiment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopExperimentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopExperiment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateExperimentTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateExperimentTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSafetyLeverStateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSafetyLeverState(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTargetAccountConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTargetAccountConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/fms/generated.json b/service/fms/generated.json index 8b00d3dbd68..17f35cf4d0b 100644 --- a/service/fms/generated.json +++ b/service/fms/generated.json @@ -63,6 +63,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/fms/sra_operation_order_test.go b/service/fms/sra_operation_order_test.go new file mode 100644 index 00000000000..ae9da732f82 --- /dev/null +++ b/service/fms/sra_operation_order_test.go @@ -0,0 +1,1491 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package fms + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateAdminAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateAdminAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateThirdPartyFirewallSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateThirdPartyFirewall(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchAssociateResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchAssociateResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDisassociateResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDisassociateResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAppsListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAppsList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNotificationChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNotificationChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProtocolsListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProtocolsList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourceSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourceSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateAdminAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateAdminAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateThirdPartyFirewallSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateThirdPartyFirewall(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAdminAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAdminAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAdminScopeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAdminScope(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAppsListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAppsList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetComplianceDetailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetComplianceDetail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetNotificationChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetNotificationChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetProtectionStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetProtectionStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetProtocolsListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetProtocolsList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourceSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourceSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetThirdPartyFirewallAssociationStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetThirdPartyFirewallAssociationStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetViolationDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetViolationDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAdminAccountsForOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAdminAccountsForOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAdminsManagingAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAdminsManagingAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAppsListsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAppsLists(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListComplianceStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListComplianceStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDiscoveredResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDiscoveredResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMemberAccountsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMemberAccounts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProtocolsListsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProtocolsLists(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceSetResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceSetResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListThirdPartyFirewallFirewallPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListThirdPartyFirewallFirewallPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAdminAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAdminAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAppsListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAppsList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutNotificationChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutNotificationChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutProtocolsListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutProtocolsList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResourceSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResourceSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/forecast/generated.json b/service/forecast/generated.json index 161a33ddb25..e09871ee5e4 100644 --- a/service/forecast/generated.json +++ b/service/forecast/generated.json @@ -84,6 +84,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/forecast/sra_operation_order_test.go b/service/forecast/sra_operation_order_test.go new file mode 100644 index 00000000000..20acb6a8af6 --- /dev/null +++ b/service/forecast/sra_operation_order_test.go @@ -0,0 +1,2226 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package forecast + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateAutoPredictorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAutoPredictor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDatasetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDatasetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDatasetImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDatasetImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateExplainabilitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateExplainability(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateExplainabilityExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateExplainabilityExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateForecastSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateForecast(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateForecastExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateForecastExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMonitorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMonitor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePredictorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePredictor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePredictorBacktestExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePredictorBacktestExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWhatIfAnalysisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWhatIfAnalysis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWhatIfForecastSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWhatIfForecast(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWhatIfForecastExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWhatIfForecastExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDatasetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDatasetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDatasetImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDatasetImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteExplainabilitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteExplainability(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteExplainabilityExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteExplainabilityExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteForecastSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteForecast(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteForecastExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteForecastExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMonitorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMonitor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePredictorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePredictor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePredictorBacktestExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePredictorBacktestExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourceTreeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourceTree(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWhatIfAnalysisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWhatIfAnalysis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWhatIfForecastSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWhatIfForecast(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWhatIfForecastExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWhatIfForecastExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAutoPredictorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAutoPredictor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDatasetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDatasetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDatasetImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDatasetImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeExplainabilitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeExplainability(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeExplainabilityExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeExplainabilityExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeForecastSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeForecast(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeForecastExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeForecastExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMonitorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMonitor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePredictorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePredictor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePredictorBacktestExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePredictorBacktestExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWhatIfAnalysisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWhatIfAnalysis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWhatIfForecastSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWhatIfForecast(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWhatIfForecastExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWhatIfForecastExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccuracyMetricsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccuracyMetrics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDatasetGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDatasetGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDatasetImportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDatasetImportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDatasetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDatasets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListExplainabilitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListExplainabilities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListExplainabilityExportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListExplainabilityExports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListForecastExportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListForecastExportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListForecastsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListForecasts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMonitorEvaluationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMonitorEvaluations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMonitorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMonitors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPredictorBacktestExportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPredictorBacktestExportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPredictorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPredictors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWhatIfAnalysesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWhatIfAnalyses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWhatIfForecastExportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWhatIfForecastExports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWhatIfForecastsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWhatIfForecasts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResumeResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResumeResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDatasetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDatasetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/forecastquery/generated.json b/service/forecastquery/generated.json index 47936670e71..975974dcc02 100644 --- a/service/forecastquery/generated.json +++ b/service/forecastquery/generated.json @@ -23,6 +23,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/errors.go", "types/types.go", "validators.go" diff --git a/service/forecastquery/sra_operation_order_test.go b/service/forecastquery/sra_operation_order_test.go new file mode 100644 index 00000000000..6195a940369 --- /dev/null +++ b/service/forecastquery/sra_operation_order_test.go @@ -0,0 +1,91 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package forecastquery + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpQueryForecastSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.QueryForecast(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpQueryWhatIfForecastSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.QueryWhatIfForecast(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/frauddetector/generated.json b/service/frauddetector/generated.json index 94fe1e6714c..6b22d44316c 100644 --- a/service/frauddetector/generated.json +++ b/service/frauddetector/generated.json @@ -94,6 +94,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/frauddetector/sra_operation_order_test.go b/service/frauddetector/sra_operation_order_test.go new file mode 100644 index 00000000000..f955e14ec27 --- /dev/null +++ b/service/frauddetector/sra_operation_order_test.go @@ -0,0 +1,2576 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package frauddetector + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchCreateVariableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchCreateVariable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetVariableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetVariable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelBatchImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelBatchImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelBatchPredictionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelBatchPredictionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBatchImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBatchImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBatchPredictionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBatchPredictionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDetectorVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDetectorVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateModelVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateModelVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVariableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVariable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBatchImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBatchImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBatchPredictionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBatchPredictionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDetectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDetector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDetectorVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDetectorVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEntityTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEntityType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEventSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEvent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEventsByEventTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEventsByEventType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEventTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEventType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteExternalModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteExternalModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLabelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLabel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteModelVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteModelVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteOutcomeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteOutcome(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVariableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVariable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDetectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDetector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeModelVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeModelVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBatchImportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBatchImportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBatchPredictionJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBatchPredictionJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeleteEventsByEventTypeStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeleteEventsByEventTypeStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDetectorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDetectors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDetectorVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDetectorVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEntityTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEntityTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEventSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEvent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEventPredictionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEventPrediction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEventPredictionMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEventPredictionMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEventTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEventTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetExternalModelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetExternalModels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetKMSEncryptionKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetKMSEncryptionKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLabelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLabels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetListElementsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetListElements(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetListsMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetListsMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetModelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetModels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetModelVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetModelVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOutcomesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOutcomes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVariablesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVariables(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEventPredictionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEventPredictions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutDetectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutDetector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutEntityTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutEntityType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutEventTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutEventType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutExternalModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutExternalModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutKMSEncryptionKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutKMSEncryptionKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutLabelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutLabel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutOutcomeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutOutcome(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendEventSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendEvent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDetectorVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDetectorVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDetectorVersionMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDetectorVersionMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDetectorVersionStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDetectorVersionStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEventLabelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEventLabel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateModelVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateModelVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateModelVersionStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateModelVersionStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRuleMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRuleMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRuleVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRuleVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVariableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVariable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/freetier/generated.json b/service/freetier/generated.json index 7e59a823951..33c413b761c 100644 --- a/service/freetier/generated.json +++ b/service/freetier/generated.json @@ -22,6 +22,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/freetier/sra_operation_order_test.go b/service/freetier/sra_operation_order_test.go new file mode 100644 index 00000000000..d2989bae61c --- /dev/null +++ b/service/freetier/sra_operation_order_test.go @@ -0,0 +1,56 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package freetier + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpGetFreeTierUsageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFreeTierUsage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/fsx/generated.json b/service/fsx/generated.json index 6521e84bd6c..5744c9bb527 100644 --- a/service/fsx/generated.json +++ b/service/fsx/generated.json @@ -66,6 +66,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/fsx/sra_operation_order_test.go b/service/fsx/sra_operation_order_test.go new file mode 100644 index 00000000000..69a858a41c3 --- /dev/null +++ b/service/fsx/sra_operation_order_test.go @@ -0,0 +1,1596 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package fsx + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateFileSystemAliasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateFileSystemAliases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelDataRepositoryTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelDataRepositoryTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCopyBackupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopyBackup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCopySnapshotAndUpdateVolumeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopySnapshotAndUpdateVolume(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBackupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBackup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataRepositoryAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataRepositoryAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataRepositoryTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataRepositoryTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFileCacheSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFileCache(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFileSystemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFileSystem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFileSystemFromBackupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFileSystemFromBackup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStorageVirtualMachineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStorageVirtualMachine(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVolumeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVolume(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVolumeFromBackupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVolumeFromBackup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBackupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBackup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataRepositoryAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataRepositoryAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFileCacheSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFileCache(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFileSystemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFileSystem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteStorageVirtualMachineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteStorageVirtualMachine(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVolumeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVolume(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBackupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBackups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDataRepositoryAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDataRepositoryAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDataRepositoryTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDataRepositoryTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFileCachesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFileCaches(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFileSystemAliasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFileSystemAliases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFileSystemsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFileSystems(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSharedVpcConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSharedVpcConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSnapshotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSnapshots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStorageVirtualMachinesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStorageVirtualMachines(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVolumesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVolumes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateFileSystemAliasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateFileSystemAliases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReleaseFileSystemNfsV3LocksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReleaseFileSystemNfsV3Locks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreVolumeFromSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreVolumeFromSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMisconfiguredStateRecoverySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMisconfiguredStateRecovery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDataRepositoryAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataRepositoryAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFileCacheSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFileCache(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFileSystemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFileSystem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSharedVpcConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSharedVpcConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateStorageVirtualMachineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateStorageVirtualMachine(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVolumeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVolume(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/gamelift/generated.json b/service/gamelift/generated.json index 3954a4f99f5..d8d32d3aecb 100644 --- a/service/gamelift/generated.json +++ b/service/gamelift/generated.json @@ -139,6 +139,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/gamelift/sra_operation_order_test.go b/service/gamelift/sra_operation_order_test.go new file mode 100644 index 00000000000..8c53d19d794 --- /dev/null +++ b/service/gamelift/sra_operation_order_test.go @@ -0,0 +1,4151 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package gamelift + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcceptMatchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptMatch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpClaimGameServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ClaimGameServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBuildSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBuild(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateContainerFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateContainerFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateContainerGroupDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateContainerGroupDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFleetLocationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFleetLocations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGameServerGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGameServerGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGameSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGameSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGameSessionQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGameSessionQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLocationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLocation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMatchmakingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMatchmakingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMatchmakingRuleSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMatchmakingRuleSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePlayerSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePlayerSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePlayerSessionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePlayerSessions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateScriptSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateScript(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVpcPeeringAuthorizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVpcPeeringAuthorization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVpcPeeringConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVpcPeeringConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBuildSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBuild(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteContainerFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteContainerFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteContainerGroupDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteContainerGroupDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFleetLocationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFleetLocations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGameServerGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGameServerGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGameSessionQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGameSessionQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLocationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLocation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMatchmakingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMatchmakingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMatchmakingRuleSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMatchmakingRuleSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteScalingPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteScalingPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteScriptSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteScript(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVpcPeeringAuthorizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVpcPeeringAuthorization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVpcPeeringConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVpcPeeringConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterComputeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterCompute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterGameServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterGameServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBuildSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBuild(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeComputeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCompute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeContainerFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeContainerFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeContainerGroupDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeContainerGroupDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEC2InstanceLimitsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEC2InstanceLimits(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFleetAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFleetAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFleetCapacitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFleetCapacity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFleetDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFleetDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFleetEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFleetEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFleetLocationAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFleetLocationAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFleetLocationCapacitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFleetLocationCapacity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFleetLocationUtilizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFleetLocationUtilization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFleetPortSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFleetPortSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFleetUtilizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFleetUtilization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGameServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGameServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGameServerGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGameServerGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGameServerInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGameServerInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGameSessionDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGameSessionDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGameSessionPlacementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGameSessionPlacement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGameSessionQueuesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGameSessionQueues(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGameSessionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGameSessions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMatchmakingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMatchmaking(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMatchmakingConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMatchmakingConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMatchmakingRuleSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMatchmakingRuleSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePlayerSessionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePlayerSessions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRuntimeConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRuntimeConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeScalingPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeScalingPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeScriptSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeScript(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVpcPeeringAuthorizationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVpcPeeringAuthorizations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVpcPeeringConnectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVpcPeeringConnections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetComputeAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetComputeAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetComputeAuthTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetComputeAuthToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGameSessionLogUrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGameSessionLogUrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInstanceAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInstanceAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAliasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAliases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBuildsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBuilds(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListComputeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCompute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListContainerFleetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListContainerFleets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListContainerGroupDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListContainerGroupDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListContainerGroupDefinitionVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListContainerGroupDefinitionVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFleetDeploymentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFleetDeployments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFleetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFleets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGameServerGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGameServerGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGameServersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGameServers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLocationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLocations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListScriptsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListScripts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutScalingPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutScalingPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterComputeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterCompute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterGameServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterGameServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRequestUploadCredentialsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RequestUploadCredentials(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResolveAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResolveAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResumeGameServerGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResumeGameServerGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchGameSessionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchGameSessions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartFleetActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartFleetActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartGameSessionPlacementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartGameSessionPlacement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMatchBackfillSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMatchBackfill(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMatchmakingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMatchmaking(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopFleetActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopFleetActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopGameSessionPlacementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopGameSessionPlacement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopMatchmakingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopMatchmaking(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSuspendGameServerGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SuspendGameServerGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTerminateGameSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TerminateGameSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBuildSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBuild(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateContainerFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateContainerFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateContainerGroupDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateContainerGroupDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFleetAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFleetAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFleetCapacitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFleetCapacity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFleetPortSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFleetPortSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGameServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGameServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGameServerGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGameServerGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGameSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGameSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGameSessionQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGameSessionQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMatchmakingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMatchmakingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRuntimeConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRuntimeConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateScriptSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateScript(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpValidateMatchmakingRuleSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ValidateMatchmakingRuleSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/geomaps/generated.json b/service/geomaps/generated.json index 9d6816d7044..1743805b09e 100644 --- a/service/geomaps/generated.json +++ b/service/geomaps/generated.json @@ -26,6 +26,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/geomaps/sra_operation_order_test.go b/service/geomaps/sra_operation_order_test.go new file mode 100644 index 00000000000..db4f8231c8c --- /dev/null +++ b/service/geomaps/sra_operation_order_test.go @@ -0,0 +1,196 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geomaps + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpGetGlyphsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGlyphs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSpritesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSprites(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStaticMapSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStaticMap(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStyleDescriptorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStyleDescriptor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/geoplaces/generated.json b/service/geoplaces/generated.json index 27dbdaa81e4..3934d96c0b1 100644 --- a/service/geoplaces/generated.json +++ b/service/geoplaces/generated.json @@ -28,6 +28,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/geoplaces/sra_operation_order_test.go b/service/geoplaces/sra_operation_order_test.go new file mode 100644 index 00000000000..7c7b3aae2d0 --- /dev/null +++ b/service/geoplaces/sra_operation_order_test.go @@ -0,0 +1,266 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package geoplaces + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAutocompleteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Autocomplete(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGeocodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Geocode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPlaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPlace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReverseGeocodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReverseGeocode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchNearbySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchNearby(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchTextSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchText(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSuggestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Suggest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/georoutes/generated.json b/service/georoutes/generated.json index 0b1656b4436..dcada96fb67 100644 --- a/service/georoutes/generated.json +++ b/service/georoutes/generated.json @@ -26,6 +26,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/georoutes/sra_operation_order_test.go b/service/georoutes/sra_operation_order_test.go new file mode 100644 index 00000000000..2dcc7af9887 --- /dev/null +++ b/service/georoutes/sra_operation_order_test.go @@ -0,0 +1,196 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package georoutes + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCalculateIsolinesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CalculateIsolines(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCalculateRouteMatrixSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CalculateRouteMatrix(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCalculateRoutesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CalculateRoutes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpOptimizeWaypointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.OptimizeWaypoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSnapToRoadsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SnapToRoads(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/glacier/generated.json b/service/glacier/generated.json index ac22cf7806f..bdbfab93d46 100644 --- a/service/glacier/generated.json +++ b/service/glacier/generated.json @@ -54,6 +54,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/glacier/sra_operation_order_test.go b/service/glacier/sra_operation_order_test.go new file mode 100644 index 00000000000..92fb41ef35e --- /dev/null +++ b/service/glacier/sra_operation_order_test.go @@ -0,0 +1,1176 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package glacier + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAbortMultipartUploadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AbortMultipartUpload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAbortVaultLockSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AbortVaultLock(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddTagsToVaultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddTagsToVault(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCompleteMultipartUploadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CompleteMultipartUpload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCompleteVaultLockSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CompleteVaultLock(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVaultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVault(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteArchiveSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteArchive(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVaultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVault(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVaultAccessPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVaultAccessPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVaultNotificationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVaultNotifications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVaultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVault(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataRetrievalPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataRetrievalPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetJobOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetJobOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVaultAccessPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVaultAccessPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVaultLockSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVaultLock(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVaultNotificationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVaultNotifications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInitiateJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InitiateJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInitiateMultipartUploadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InitiateMultipartUpload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInitiateVaultLockSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InitiateVaultLock(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMultipartUploadsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMultipartUploads(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPartsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListParts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProvisionedCapacitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProvisionedCapacity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForVaultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForVault(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVaultsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVaults(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPurchaseProvisionedCapacitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PurchaseProvisionedCapacity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveTagsFromVaultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveTagsFromVault(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetDataRetrievalPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetDataRetrievalPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetVaultAccessPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetVaultAccessPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetVaultNotificationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetVaultNotifications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUploadArchiveSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UploadArchive(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUploadMultipartPartSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UploadMultipartPart(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/globalaccelerator/generated.json b/service/globalaccelerator/generated.json index 0e638199716..77577716bf9 100644 --- a/service/globalaccelerator/generated.json +++ b/service/globalaccelerator/generated.json @@ -77,6 +77,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/globalaccelerator/sra_operation_order_test.go b/service/globalaccelerator/sra_operation_order_test.go new file mode 100644 index 00000000000..b286eb5ef62 --- /dev/null +++ b/service/globalaccelerator/sra_operation_order_test.go @@ -0,0 +1,1981 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package globalaccelerator + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddCustomRoutingEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddCustomRoutingEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAdvertiseByoipCidrSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AdvertiseByoipCidr(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAllowCustomRoutingTrafficSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AllowCustomRoutingTraffic(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAcceleratorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAccelerator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCrossAccountAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCrossAccountAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCustomRoutingAcceleratorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCustomRoutingAccelerator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCustomRoutingEndpointGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCustomRoutingEndpointGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCustomRoutingListenerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCustomRoutingListener(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEndpointGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEndpointGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateListenerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateListener(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAcceleratorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccelerator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCrossAccountAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCrossAccountAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCustomRoutingAcceleratorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCustomRoutingAccelerator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCustomRoutingEndpointGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCustomRoutingEndpointGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCustomRoutingListenerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCustomRoutingListener(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEndpointGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEndpointGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteListenerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteListener(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDenyCustomRoutingTrafficSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DenyCustomRoutingTraffic(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeprovisionByoipCidrSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeprovisionByoipCidr(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAcceleratorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccelerator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAcceleratorAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAcceleratorAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCrossAccountAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCrossAccountAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCustomRoutingAcceleratorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCustomRoutingAccelerator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCustomRoutingAcceleratorAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCustomRoutingAcceleratorAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCustomRoutingEndpointGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCustomRoutingEndpointGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCustomRoutingListenerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCustomRoutingListener(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEndpointGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEndpointGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeListenerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeListener(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAcceleratorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccelerators(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListByoipCidrsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListByoipCidrs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCrossAccountAttachmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCrossAccountAttachments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCrossAccountResourceAccountsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCrossAccountResourceAccounts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCrossAccountResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCrossAccountResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCustomRoutingAcceleratorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCustomRoutingAccelerators(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCustomRoutingEndpointGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCustomRoutingEndpointGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCustomRoutingListenersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCustomRoutingListeners(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCustomRoutingPortMappingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCustomRoutingPortMappings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCustomRoutingPortMappingsByDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCustomRoutingPortMappingsByDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEndpointGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEndpointGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListListenersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListListeners(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpProvisionByoipCidrSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ProvisionByoipCidr(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveCustomRoutingEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveCustomRoutingEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAcceleratorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAccelerator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAcceleratorAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAcceleratorAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCrossAccountAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCrossAccountAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCustomRoutingAcceleratorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCustomRoutingAccelerator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCustomRoutingAcceleratorAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCustomRoutingAcceleratorAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCustomRoutingListenerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCustomRoutingListener(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEndpointGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEndpointGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateListenerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateListener(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpWithdrawByoipCidrSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.WithdrawByoipCidr(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/glue/generated.json b/service/glue/generated.json index 49ed74b9b04..94fd3ec6296 100644 --- a/service/glue/generated.json +++ b/service/glue/generated.json @@ -278,6 +278,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/glue/sra_operation_order_test.go b/service/glue/sra_operation_order_test.go new file mode 100644 index 00000000000..242e3e9dba1 --- /dev/null +++ b/service/glue/sra_operation_order_test.go @@ -0,0 +1,8876 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package glue + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchCreatePartitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchCreatePartition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeleteConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeletePartitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeletePartition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeleteTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeleteTableVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteTableVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetBlueprintsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetBlueprints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetCrawlersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetCrawlers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetCustomEntityTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetCustomEntityTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetDataQualityResultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetDataQualityResult(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetDevEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetDevEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetPartitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetPartition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetTableOptimizerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetTableOptimizer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetTriggersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetTriggers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetWorkflowsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetWorkflows(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchPutDataQualityStatisticAnnotationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchPutDataQualityStatisticAnnotation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchStopJobRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchStopJobRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchUpdatePartitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchUpdatePartition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelDataQualityRuleRecommendationRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelDataQualityRuleRecommendationRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelDataQualityRulesetEvaluationRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelDataQualityRulesetEvaluationRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelMLTaskRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelMLTaskRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelStatementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelStatement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCheckSchemaVersionValiditySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CheckSchemaVersionValidity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBlueprintSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBlueprint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCatalogSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCatalog(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateClassifierSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateClassifier(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateColumnStatisticsTaskSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateColumnStatisticsTaskSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCrawlerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCrawler(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCustomEntityTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCustomEntityType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDatabaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDatabase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataQualityRulesetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataQualityRuleset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDevEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDevEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIntegrationResourcePropertySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIntegrationResourceProperty(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIntegrationTablePropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIntegrationTableProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMLTransformSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMLTransform(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePartitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePartition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePartitionIndexSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePartitionIndex(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRegistrySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRegistry(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSchemaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSchema(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateScriptSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateScript(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSecurityConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSecurityConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTableOptimizerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTableOptimizer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTriggerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTrigger(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUsageProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUsageProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUserDefinedFunctionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUserDefinedFunction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBlueprintSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBlueprint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCatalogSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCatalog(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteClassifierSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteClassifier(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteColumnStatisticsForPartitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteColumnStatisticsForPartition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteColumnStatisticsForTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteColumnStatisticsForTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteColumnStatisticsTaskSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteColumnStatisticsTaskSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCrawlerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCrawler(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCustomEntityTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCustomEntityType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDatabaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDatabase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataQualityRulesetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataQualityRuleset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDevEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDevEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIntegrationTablePropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIntegrationTableProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMLTransformSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMLTransform(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePartitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePartition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePartitionIndexSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePartitionIndex(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRegistrySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRegistry(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSchemaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSchema(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSchemaVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSchemaVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSecurityConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSecurityConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTableOptimizerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTableOptimizer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTableVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTableVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTriggerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTrigger(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUsageProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUsageProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserDefinedFunctionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUserDefinedFunction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConnectionTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConnectionType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEntitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEntity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInboundIntegrationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInboundIntegrations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIntegrationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIntegrations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBlueprintSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBlueprint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBlueprintRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBlueprintRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBlueprintRunsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBlueprintRuns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCatalogSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCatalog(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCatalogImportStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCatalogImportStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCatalogsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCatalogs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetClassifierSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetClassifier(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetClassifiersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetClassifiers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetColumnStatisticsForPartitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetColumnStatisticsForPartition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetColumnStatisticsForTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetColumnStatisticsForTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetColumnStatisticsTaskRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetColumnStatisticsTaskRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetColumnStatisticsTaskRunsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetColumnStatisticsTaskRuns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetColumnStatisticsTaskSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetColumnStatisticsTaskSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConnectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConnections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCrawlerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCrawler(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCrawlerMetricsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCrawlerMetrics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCrawlersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCrawlers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCustomEntityTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCustomEntityType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDatabaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDatabase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDatabasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDatabases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataCatalogEncryptionSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataCatalogEncryptionSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataflowGraphSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataflowGraph(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataQualityModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataQualityModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataQualityModelResultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataQualityModelResult(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataQualityResultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataQualityResult(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataQualityRuleRecommendationRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataQualityRuleRecommendationRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataQualityRulesetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataQualityRuleset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataQualityRulesetEvaluationRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataQualityRulesetEvaluationRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDevEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDevEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDevEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDevEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEntityRecordsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEntityRecords(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIntegrationResourcePropertySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIntegrationResourceProperty(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIntegrationTablePropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIntegrationTableProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetJobBookmarkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetJobBookmark(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetJobRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetJobRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetJobRunsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetJobRuns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMappingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMapping(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMLTaskRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMLTaskRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMLTaskRunsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMLTaskRuns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMLTransformSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMLTransform(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMLTransformsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMLTransforms(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPartitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPartition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPartitionIndexesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPartitionIndexes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPartitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPartitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRegistrySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRegistry(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourcePoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourcePolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSchemaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSchema(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSchemaByDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSchemaByDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSchemaVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSchemaVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSchemaVersionsDiffSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSchemaVersionsDiff(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSecurityConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSecurityConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSecurityConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSecurityConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStatementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStatement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTableOptimizerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTableOptimizer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTablesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTables(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTableVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTableVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTableVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTableVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTriggerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTrigger(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTriggersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTriggers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUnfilteredPartitionMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUnfilteredPartitionMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUnfilteredPartitionsMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUnfilteredPartitionsMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUnfilteredTableMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUnfilteredTableMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUsageProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUsageProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUserDefinedFunctionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUserDefinedFunction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUserDefinedFunctionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUserDefinedFunctions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWorkflowRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWorkflowRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWorkflowRunPropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWorkflowRunProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWorkflowRunsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWorkflowRuns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportCatalogToGlueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportCatalogToGlue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBlueprintsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBlueprints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListColumnStatisticsTaskRunsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListColumnStatisticsTaskRuns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConnectionTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConnectionTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCrawlersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCrawlers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCrawlsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCrawls(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCustomEntityTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCustomEntityTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataQualityResultsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataQualityResults(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataQualityRuleRecommendationRunsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataQualityRuleRecommendationRuns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataQualityRulesetEvaluationRunsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataQualityRulesetEvaluationRuns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataQualityRulesetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataQualityRulesets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataQualityStatisticAnnotationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataQualityStatisticAnnotations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataQualityStatisticsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataQualityStatistics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDevEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDevEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEntitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEntities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMLTransformsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMLTransforms(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRegistriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRegistries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSchemasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSchemas(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSchemaVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSchemaVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSessionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSessions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStatementsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStatements(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTableOptimizerRunsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTableOptimizerRuns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTriggersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTriggers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUsageProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUsageProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkflowsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkflows(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutDataCatalogEncryptionSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutDataCatalogEncryptionSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutDataQualityProfileAnnotationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutDataQualityProfileAnnotation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutSchemaVersionMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutSchemaVersionMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutWorkflowRunPropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutWorkflowRunProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpQuerySchemaVersionMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.QuerySchemaVersionMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterSchemaVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterSchemaVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveSchemaVersionMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveSchemaVersionMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetJobBookmarkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetJobBookmark(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResumeWorkflowRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResumeWorkflowRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRunStatementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RunStatement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchTablesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchTables(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartBlueprintRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartBlueprintRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartColumnStatisticsTaskRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartColumnStatisticsTaskRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartColumnStatisticsTaskRunScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartColumnStatisticsTaskRunSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartCrawlerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartCrawler(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartCrawlerScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartCrawlerSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDataQualityRuleRecommendationRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDataQualityRuleRecommendationRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDataQualityRulesetEvaluationRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDataQualityRulesetEvaluationRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartExportLabelsTaskRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartExportLabelsTaskRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartImportLabelsTaskRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartImportLabelsTaskRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartJobRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartJobRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMLEvaluationTaskRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMLEvaluationTaskRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMLLabelingSetGenerationTaskRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMLLabelingSetGenerationTaskRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartTriggerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartTrigger(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartWorkflowRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartWorkflowRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopColumnStatisticsTaskRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopColumnStatisticsTaskRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopColumnStatisticsTaskRunScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopColumnStatisticsTaskRunSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopCrawlerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopCrawler(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopCrawlerScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopCrawlerSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopTriggerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopTrigger(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopWorkflowRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopWorkflowRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBlueprintSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBlueprint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCatalogSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCatalog(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateClassifierSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateClassifier(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateColumnStatisticsForPartitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateColumnStatisticsForPartition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateColumnStatisticsForTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateColumnStatisticsForTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateColumnStatisticsTaskSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateColumnStatisticsTaskSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCrawlerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCrawler(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCrawlerScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCrawlerSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDatabaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDatabase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDataQualityRulesetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataQualityRuleset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDevEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDevEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIntegrationResourcePropertySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIntegrationResourceProperty(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIntegrationTablePropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIntegrationTableProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateJobFromSourceControlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateJobFromSourceControl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMLTransformSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMLTransform(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePartitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePartition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRegistrySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRegistry(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSchemaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSchema(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSourceControlFromJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSourceControlFromJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTableOptimizerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTableOptimizer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTriggerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTrigger(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUsageProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUsageProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserDefinedFunctionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUserDefinedFunction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/grafana/generated.json b/service/grafana/generated.json index 7cb17aa8b05..8aac026c7fb 100644 --- a/service/grafana/generated.json +++ b/service/grafana/generated.json @@ -46,6 +46,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/grafana/sra_operation_order_test.go b/service/grafana/sra_operation_order_test.go new file mode 100644 index 00000000000..a2c6464c3b6 --- /dev/null +++ b/service/grafana/sra_operation_order_test.go @@ -0,0 +1,896 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package grafana + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateLicenseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateLicense(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorkspaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorkspace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorkspaceApiKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorkspaceApiKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorkspaceServiceAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorkspaceServiceAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorkspaceServiceAccountTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorkspaceServiceAccountToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWorkspaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWorkspace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWorkspaceApiKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWorkspaceApiKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWorkspaceServiceAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWorkspaceServiceAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWorkspaceServiceAccountTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWorkspaceServiceAccountToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWorkspaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWorkspace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWorkspaceAuthenticationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWorkspaceAuthentication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWorkspaceConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWorkspaceConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateLicenseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateLicense(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkspacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkspaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkspaceServiceAccountsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkspaceServiceAccounts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkspaceServiceAccountTokensSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkspaceServiceAccountTokens(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWorkspaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWorkspace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWorkspaceAuthenticationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWorkspaceAuthentication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWorkspaceConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWorkspaceConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/greengrass/generated.json b/service/greengrass/generated.json index 5933ec26acb..4e53c3a3110 100644 --- a/service/greengrass/generated.json +++ b/service/greengrass/generated.json @@ -113,6 +113,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/greengrass/sra_operation_order_test.go b/service/greengrass/sra_operation_order_test.go new file mode 100644 index 00000000000..2e39135488e --- /dev/null +++ b/service/greengrass/sra_operation_order_test.go @@ -0,0 +1,3241 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package greengrass + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateRoleToGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateRoleToGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateServiceRoleToAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateServiceRoleToAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConnectorDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConnectorDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConnectorDefinitionVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConnectorDefinitionVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCoreDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCoreDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCoreDefinitionVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCoreDefinitionVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDeviceDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDeviceDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDeviceDefinitionVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDeviceDefinitionVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFunctionDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFunctionDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFunctionDefinitionVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFunctionDefinitionVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGroupCertificateAuthoritySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGroupCertificateAuthority(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGroupVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGroupVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLoggerDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLoggerDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLoggerDefinitionVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLoggerDefinitionVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateResourceDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateResourceDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateResourceDefinitionVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateResourceDefinitionVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSoftwareUpdateJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSoftwareUpdateJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSubscriptionDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSubscriptionDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSubscriptionDefinitionVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSubscriptionDefinitionVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConnectorDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConnectorDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCoreDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCoreDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDeviceDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDeviceDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFunctionDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFunctionDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLoggerDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLoggerDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourceDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourceDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSubscriptionDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSubscriptionDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateRoleFromGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateRoleFromGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateServiceRoleFromAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateServiceRoleFromAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAssociatedRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAssociatedRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBulkDeploymentStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBulkDeploymentStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConnectivityInfoSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConnectivityInfo(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConnectorDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConnectorDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConnectorDefinitionVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConnectorDefinitionVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCoreDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCoreDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCoreDefinitionVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCoreDefinitionVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeploymentStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeploymentStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeviceDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeviceDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeviceDefinitionVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeviceDefinitionVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFunctionDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFunctionDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFunctionDefinitionVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFunctionDefinitionVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGroupCertificateAuthoritySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGroupCertificateAuthority(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGroupCertificateConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGroupCertificateConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGroupVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGroupVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLoggerDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLoggerDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLoggerDefinitionVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLoggerDefinitionVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourceDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourceDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourceDefinitionVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourceDefinitionVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceRoleForAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServiceRoleForAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSubscriptionDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSubscriptionDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSubscriptionDefinitionVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSubscriptionDefinitionVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetThingRuntimeConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetThingRuntimeConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBulkDeploymentDetailedReportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBulkDeploymentDetailedReports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBulkDeploymentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBulkDeployments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConnectorDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConnectorDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConnectorDefinitionVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConnectorDefinitionVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCoreDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCoreDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCoreDefinitionVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCoreDefinitionVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDeploymentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDeployments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDeviceDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDeviceDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDeviceDefinitionVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDeviceDefinitionVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFunctionDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFunctionDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFunctionDefinitionVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFunctionDefinitionVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGroupCertificateAuthoritiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGroupCertificateAuthorities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGroupVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGroupVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLoggerDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLoggerDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLoggerDefinitionVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLoggerDefinitionVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceDefinitionVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceDefinitionVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSubscriptionDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSubscriptionDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSubscriptionDefinitionVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSubscriptionDefinitionVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetDeploymentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetDeployments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartBulkDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartBulkDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopBulkDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopBulkDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConnectivityInfoSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConnectivityInfo(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConnectorDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConnectorDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCoreDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCoreDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDeviceDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDeviceDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFunctionDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFunctionDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGroupCertificateConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGroupCertificateConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLoggerDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLoggerDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateResourceDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateResourceDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSubscriptionDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSubscriptionDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateThingRuntimeConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateThingRuntimeConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/greengrassv2/generated.json b/service/greengrassv2/generated.json index f68637fd055..0aed689bf78 100644 --- a/service/greengrassv2/generated.json +++ b/service/greengrassv2/generated.json @@ -50,6 +50,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/greengrassv2/sra_operation_order_test.go b/service/greengrassv2/sra_operation_order_test.go new file mode 100644 index 00000000000..466bdcd6302 --- /dev/null +++ b/service/greengrassv2/sra_operation_order_test.go @@ -0,0 +1,1036 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package greengrassv2 + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateServiceRoleToAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateServiceRoleToAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchAssociateClientDeviceWithCoreDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchAssociateClientDeviceWithCoreDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDisassociateClientDeviceFromCoreDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDisassociateClientDeviceFromCoreDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateComponentVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateComponentVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCoreDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCoreDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateServiceRoleFromAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateServiceRoleFromAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetComponentVersionArtifactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetComponentVersionArtifact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConnectivityInfoSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConnectivityInfo(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCoreDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCoreDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceRoleForAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServiceRoleForAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListClientDevicesAssociatedWithCoreDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListClientDevicesAssociatedWithCoreDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListComponentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListComponents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListComponentVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListComponentVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCoreDevicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCoreDevices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDeploymentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDeployments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEffectiveDeploymentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEffectiveDeployments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInstalledComponentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInstalledComponents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResolveComponentCandidatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResolveComponentCandidates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConnectivityInfoSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConnectivityInfo(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/groundstation/generated.json b/service/groundstation/generated.json index 7ed2836b3d6..8a0789b42df 100644 --- a/service/groundstation/generated.json +++ b/service/groundstation/generated.json @@ -54,6 +54,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/groundstation/sra_operation_order_test.go b/service/groundstation/sra_operation_order_test.go new file mode 100644 index 00000000000..0963ef6b805 --- /dev/null +++ b/service/groundstation/sra_operation_order_test.go @@ -0,0 +1,1176 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package groundstation + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCancelContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataflowEndpointGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataflowEndpointGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEphemerisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEphemeris(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMissionProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMissionProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataflowEndpointGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataflowEndpointGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEphemerisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEphemeris(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMissionProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMissionProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEphemerisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEphemeris(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAgentConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAgentConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataflowEndpointGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataflowEndpointGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMinuteUsageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMinuteUsage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMissionProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMissionProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSatelliteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSatellite(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConfigsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConfigs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListContactsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListContacts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataflowEndpointGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataflowEndpointGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEphemeridesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEphemerides(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGroundStationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGroundStations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMissionProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMissionProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSatellitesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSatellites(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterAgentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterAgent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReserveContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReserveContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAgentStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAgentStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEphemerisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEphemeris(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMissionProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMissionProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/guardduty/generated.json b/service/guardduty/generated.json index 196270e4e27..84bc515ea34 100644 --- a/service/guardduty/generated.json +++ b/service/guardduty/generated.json @@ -95,6 +95,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/guardduty/sra_operation_order_test.go b/service/guardduty/sra_operation_order_test.go new file mode 100644 index 00000000000..94b31fc797c --- /dev/null +++ b/service/guardduty/sra_operation_order_test.go @@ -0,0 +1,2611 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package guardduty + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcceptAdministratorInvitationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptAdministratorInvitation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAcceptInvitationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptInvitation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpArchiveFindingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ArchiveFindings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDetectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDetector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIPSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIPSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMalwareProtectionPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMalwareProtectionPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePublishingDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePublishingDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSampleFindingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSampleFindings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateThreatIntelSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateThreatIntelSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeclineInvitationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeclineInvitations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDetectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDetector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInvitationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInvitations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIPSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIPSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMalwareProtectionPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMalwareProtectionPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePublishingDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePublishingDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteThreatIntelSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteThreatIntelSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMalwareScansSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMalwareScans(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOrganizationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOrganizationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePublishingDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePublishingDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableOrganizationAdminAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableOrganizationAdminAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateFromAdministratorAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateFromAdministratorAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateFromMasterAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateFromMasterAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableOrganizationAdminAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableOrganizationAdminAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAdministratorAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAdministratorAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCoverageStatisticsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCoverageStatistics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDetectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDetector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFindingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFindings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFindingsStatisticsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFindingsStatistics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInvitationsCountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInvitationsCount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIPSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIPSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMalwareProtectionPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMalwareProtectionPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMalwareScanSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMalwareScanSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMasterAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMasterAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMemberDetectorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMemberDetectors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOrganizationStatisticsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOrganizationStatistics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRemainingFreeTrialDaysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRemainingFreeTrialDays(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetThreatIntelSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetThreatIntelSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUsageStatisticsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUsageStatistics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInviteMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InviteMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCoverageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCoverage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDetectorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDetectors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFiltersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFilters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFindingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFindings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInvitationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInvitations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIPSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIPSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMalwareProtectionPlansSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMalwareProtectionPlans(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOrganizationAdminAccountsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOrganizationAdminAccounts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPublishingDestinationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPublishingDestinations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListThreatIntelSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListThreatIntelSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMalwareScanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMalwareScan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMonitoringMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMonitoringMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopMonitoringMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopMonitoringMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUnarchiveFindingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UnarchiveFindings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDetectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDetector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFindingsFeedbackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFindingsFeedback(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIPSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIPSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMalwareProtectionPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMalwareProtectionPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMalwareScanSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMalwareScanSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMemberDetectorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMemberDetectors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateOrganizationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateOrganizationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePublishingDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePublishingDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateThreatIntelSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateThreatIntelSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/health/generated.json b/service/health/generated.json index b11e3afd78a..441d5ab61dd 100644 --- a/service/health/generated.json +++ b/service/health/generated.json @@ -35,6 +35,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/health/sra_operation_order_test.go b/service/health/sra_operation_order_test.go new file mode 100644 index 00000000000..6b8afac6cae --- /dev/null +++ b/service/health/sra_operation_order_test.go @@ -0,0 +1,511 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package health + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpDescribeAffectedAccountsForOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAffectedAccountsForOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAffectedEntitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAffectedEntities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAffectedEntitiesForOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAffectedEntitiesForOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEntityAggregatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEntityAggregates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEntityAggregatesForOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEntityAggregatesForOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventAggregatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEventAggregates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEventDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventDetailsForOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEventDetailsForOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventsForOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEventsForOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEventTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeHealthServiceStatusForOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeHealthServiceStatusForOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableHealthServiceAccessForOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableHealthServiceAccessForOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableHealthServiceAccessForOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableHealthServiceAccessForOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/healthlake/generated.json b/service/healthlake/generated.json index dabf1f145c6..69bee2892ec 100644 --- a/service/healthlake/generated.json +++ b/service/healthlake/generated.json @@ -34,6 +34,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/healthlake/sra_operation_order_test.go b/service/healthlake/sra_operation_order_test.go new file mode 100644 index 00000000000..4b0ecda6479 --- /dev/null +++ b/service/healthlake/sra_operation_order_test.go @@ -0,0 +1,476 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package healthlake + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateFHIRDatastoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFHIRDatastore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFHIRDatastoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFHIRDatastore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFHIRDatastoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFHIRDatastore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFHIRExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFHIRExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFHIRImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFHIRImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFHIRDatastoresSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFHIRDatastores(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFHIRExportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFHIRExportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFHIRImportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFHIRImportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartFHIRExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartFHIRExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartFHIRImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartFHIRImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/iam/generated.json b/service/iam/generated.json index 6480a123e9c..0832b8bd69d 100644 --- a/service/iam/generated.json +++ b/service/iam/generated.json @@ -185,6 +185,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/iam/sra_operation_order_test.go b/service/iam/sra_operation_order_test.go new file mode 100644 index 00000000000..6c1b61f4756 --- /dev/null +++ b/service/iam/sra_operation_order_test.go @@ -0,0 +1,5761 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iam + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddClientIDToOpenIDConnectProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddClientIDToOpenIDConnectProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddRoleToInstanceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddRoleToInstanceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddUserToGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddUserToGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachGroupPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachGroupPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachRolePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachRolePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachUserPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachUserPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpChangePasswordSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ChangePassword(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAccessKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAccessKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAccountAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAccountAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInstanceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInstanceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLoginProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLoginProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateOpenIDConnectProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateOpenIDConnectProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePolicyVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePolicyVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSAMLProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSAMLProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateServiceLinkedRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateServiceLinkedRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateServiceSpecificCredentialSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateServiceSpecificCredential(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVirtualMFADeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVirtualMFADevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeactivateMFADeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeactivateMFADevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccessKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccessKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccountAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccountAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccountPasswordPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccountPasswordPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGroupPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGroupPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInstanceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInstanceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLoginProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLoginProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteOpenIDConnectProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteOpenIDConnectProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePolicyVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePolicyVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRolePermissionsBoundarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRolePermissionsBoundary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRolePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRolePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSAMLProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSAMLProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteServerCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteServerCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteServiceLinkedRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteServiceLinkedRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteServiceSpecificCredentialSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteServiceSpecificCredential(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSigningCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSigningCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSSHPublicKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSSHPublicKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserPermissionsBoundarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUserPermissionsBoundary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUserPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVirtualMFADeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVirtualMFADevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachGroupPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachGroupPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachRolePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachRolePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachUserPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachUserPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableOrganizationsRootCredentialsManagementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableOrganizationsRootCredentialsManagement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableOrganizationsRootSessionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableOrganizationsRootSessions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableMFADeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableMFADevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableOrganizationsRootCredentialsManagementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableOrganizationsRootCredentialsManagement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableOrganizationsRootSessionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableOrganizationsRootSessions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGenerateCredentialReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GenerateCredentialReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGenerateOrganizationsAccessReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GenerateOrganizationsAccessReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGenerateServiceLastAccessedDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GenerateServiceLastAccessedDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccessKeyLastUsedSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccessKeyLastUsed(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccountAuthorizationDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccountAuthorizationDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccountPasswordPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccountPasswordPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccountSummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccountSummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetContextKeysForCustomPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetContextKeysForCustomPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetContextKeysForPrincipalPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetContextKeysForPrincipalPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCredentialReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCredentialReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGroupPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGroupPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInstanceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInstanceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLoginProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLoginProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMFADeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMFADevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOpenIDConnectProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOpenIDConnectProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOrganizationsAccessReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOrganizationsAccessReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPolicyVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPolicyVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRolePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRolePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSAMLProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSAMLProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServerCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServerCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceLastAccessedDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServiceLastAccessedDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceLastAccessedDetailsWithEntitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServiceLastAccessedDetailsWithEntities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceLinkedRoleDeletionStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServiceLinkedRoleDeletionStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSSHPublicKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSSHPublicKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUserPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUserPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccessKeysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccessKeys(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccountAliasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccountAliases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAttachedGroupPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAttachedGroupPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAttachedRolePoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAttachedRolePolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAttachedUserPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAttachedUserPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEntitiesForPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEntitiesForPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGroupPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGroupPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGroupsForUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGroupsForUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInstanceProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInstanceProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInstanceProfilesForRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInstanceProfilesForRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInstanceProfileTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInstanceProfileTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMFADevicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMFADevices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMFADeviceTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMFADeviceTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOpenIDConnectProvidersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOpenIDConnectProviders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOpenIDConnectProviderTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOpenIDConnectProviderTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOrganizationsFeaturesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOrganizationsFeatures(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPoliciesGrantingServiceAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPoliciesGrantingServiceAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPolicyTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPolicyTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPolicyVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPolicyVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRolePoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRolePolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRolesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRoles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRoleTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRoleTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSAMLProvidersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSAMLProviders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSAMLProviderTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSAMLProviderTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServerCertificatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServerCertificates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServerCertificateTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServerCertificateTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServiceSpecificCredentialsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServiceSpecificCredentials(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSigningCertificatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSigningCertificates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSSHPublicKeysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSSHPublicKeys(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUserPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUserPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUsersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUsers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUserTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUserTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVirtualMFADevicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVirtualMFADevices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutGroupPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutGroupPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRolePermissionsBoundarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRolePermissionsBoundary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRolePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRolePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutUserPermissionsBoundarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutUserPermissionsBoundary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutUserPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutUserPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveClientIDFromOpenIDConnectProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveClientIDFromOpenIDConnectProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveRoleFromInstanceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveRoleFromInstanceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveUserFromGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveUserFromGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetServiceSpecificCredentialSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetServiceSpecificCredential(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResyncMFADeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResyncMFADevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetDefaultPolicyVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetDefaultPolicyVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetSecurityTokenServicePreferencesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetSecurityTokenServicePreferences(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSimulateCustomPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SimulateCustomPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSimulatePrincipalPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SimulatePrincipalPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagInstanceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagInstanceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagMFADeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagMFADevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagOpenIDConnectProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagOpenIDConnectProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagSAMLProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagSAMLProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagServerCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagServerCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagInstanceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagInstanceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagMFADeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagMFADevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagOpenIDConnectProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagOpenIDConnectProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagSAMLProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagSAMLProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagServerCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagServerCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAccessKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAccessKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAccountPasswordPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAccountPasswordPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAssumeRolePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAssumeRolePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLoginProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLoginProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateOpenIDConnectProviderThumbprintSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateOpenIDConnectProviderThumbprint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRoleDescriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRoleDescription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSAMLProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSAMLProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateServerCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateServerCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateServiceSpecificCredentialSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateServiceSpecificCredential(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSigningCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSigningCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSSHPublicKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSSHPublicKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUploadServerCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UploadServerCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUploadSigningCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UploadSigningCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUploadSSHPublicKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UploadSSHPublicKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/identitystore/generated.json b/service/identitystore/generated.json index b2a4a6d7507..8c172544a6b 100644 --- a/service/identitystore/generated.json +++ b/service/identitystore/generated.json @@ -44,6 +44,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/identitystore/sra_operation_order_test.go b/service/identitystore/sra_operation_order_test.go new file mode 100644 index 00000000000..133d4c2b676 --- /dev/null +++ b/service/identitystore/sra_operation_order_test.go @@ -0,0 +1,686 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package identitystore + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGroupMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGroupMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGroupMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGroupMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGroupMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGroupMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGroupIdSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGroupId(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGroupMembershipIdSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGroupMembershipId(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUserIdSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUserId(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpIsMemberInGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.IsMemberInGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGroupMembershipsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGroupMemberships(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGroupMembershipsForMemberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGroupMembershipsForMember(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUsersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUsers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/imagebuilder/generated.json b/service/imagebuilder/generated.json index 2e1452299da..0b24ef1ce66 100644 --- a/service/imagebuilder/generated.json +++ b/service/imagebuilder/generated.json @@ -96,6 +96,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/imagebuilder/sra_operation_order_test.go b/service/imagebuilder/sra_operation_order_test.go new file mode 100644 index 00000000000..3abaf070623 --- /dev/null +++ b/service/imagebuilder/sra_operation_order_test.go @@ -0,0 +1,2646 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package imagebuilder + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCancelImageCreationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelImageCreation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelLifecycleExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelLifecycleExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateContainerRecipeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateContainerRecipe(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDistributionConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDistributionConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateImagePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateImagePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateImageRecipeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateImageRecipe(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInfrastructureConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInfrastructureConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLifecyclePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLifecyclePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteContainerRecipeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteContainerRecipe(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDistributionConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDistributionConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteImagePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteImagePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteImageRecipeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteImageRecipe(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInfrastructureConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInfrastructureConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLifecyclePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLifecyclePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetComponentPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetComponentPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetContainerRecipeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetContainerRecipe(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetContainerRecipePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetContainerRecipePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDistributionConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDistributionConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetImagePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetImagePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetImagePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetImagePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetImageRecipeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetImageRecipe(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetImageRecipePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetImageRecipePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInfrastructureConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInfrastructureConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLifecycleExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLifecycleExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLifecyclePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLifecyclePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMarketplaceResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMarketplaceResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWorkflowExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWorkflowExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWorkflowStepExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWorkflowStepExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportDiskImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportDiskImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportVmImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportVmImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListComponentBuildVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListComponentBuildVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListComponentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListComponents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListContainerRecipesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListContainerRecipes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDistributionConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDistributionConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListImageBuildVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListImageBuildVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListImagePackagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListImagePackages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListImagePipelineImagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListImagePipelineImages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListImagePipelinesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListImagePipelines(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListImageRecipesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListImageRecipes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListImagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListImages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListImageScanFindingAggregationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListImageScanFindingAggregations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListImageScanFindingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListImageScanFindings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInfrastructureConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInfrastructureConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLifecycleExecutionResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLifecycleExecutionResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLifecycleExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLifecycleExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLifecyclePoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLifecyclePolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWaitingWorkflowStepsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWaitingWorkflowSteps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkflowBuildVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkflowBuildVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkflowExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkflowExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkflowsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkflows(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkflowStepExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkflowStepExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutComponentPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutComponentPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutContainerRecipePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutContainerRecipePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutImagePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutImagePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutImageRecipePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutImageRecipePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendWorkflowStepActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendWorkflowStepAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartImagePipelineExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartImagePipelineExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartResourceStateUpdateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartResourceStateUpdate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDistributionConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDistributionConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateImagePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateImagePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateInfrastructureConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateInfrastructureConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLifecyclePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLifecyclePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/inspector/generated.json b/service/inspector/generated.json index 63652d5e278..3499b32cc20 100644 --- a/service/inspector/generated.json +++ b/service/inspector/generated.json @@ -58,6 +58,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/inspector/sra_operation_order_test.go b/service/inspector/sra_operation_order_test.go new file mode 100644 index 00000000000..77bcba241df --- /dev/null +++ b/service/inspector/sra_operation_order_test.go @@ -0,0 +1,1316 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package inspector + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddAttributesToFindingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddAttributesToFindings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAssessmentTargetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAssessmentTarget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAssessmentTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAssessmentTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateExclusionsPreviewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateExclusionsPreview(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateResourceGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateResourceGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAssessmentRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAssessmentRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAssessmentTargetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAssessmentTarget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAssessmentTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAssessmentTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAssessmentRunsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAssessmentRuns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAssessmentTargetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAssessmentTargets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAssessmentTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAssessmentTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCrossAccountAccessRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCrossAccountAccessRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeExclusionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeExclusions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFindingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFindings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeResourceGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeResourceGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRulesPackagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRulesPackages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAssessmentReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAssessmentReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetExclusionsPreviewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetExclusionsPreview(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTelemetryMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTelemetryMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssessmentRunAgentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssessmentRunAgents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssessmentRunsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssessmentRuns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssessmentTargetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssessmentTargets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssessmentTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssessmentTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEventSubscriptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEventSubscriptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListExclusionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListExclusions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFindingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFindings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRulesPackagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRulesPackages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPreviewAgentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PreviewAgents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterCrossAccountAccessRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterCrossAccountAccessRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveAttributesFromFindingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveAttributesFromFindings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartAssessmentRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartAssessmentRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopAssessmentRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopAssessmentRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSubscribeToEventSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SubscribeToEvent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUnsubscribeFromEventSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UnsubscribeFromEvent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAssessmentTargetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAssessmentTarget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/inspector2/generated.json b/service/inspector2/generated.json index 5bfc0ee3a76..ba6323ce6e3 100644 --- a/service/inspector2/generated.json +++ b/service/inspector2/generated.json @@ -80,6 +80,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/inspector2/sra_operation_order_test.go b/service/inspector2/sra_operation_order_test.go new file mode 100644 index 00000000000..42a56855224 --- /dev/null +++ b/service/inspector2/sra_operation_order_test.go @@ -0,0 +1,2086 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package inspector2 + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateMemberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateMember(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetAccountStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetAccountStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetCodeSnippetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetCodeSnippet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetFindingDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetFindingDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetFreeTrialInfoSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetFreeTrialInfo(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetMemberEc2DeepInspectionStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetMemberEc2DeepInspectionStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchUpdateMemberEc2DeepInspectionStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchUpdateMemberEc2DeepInspectionStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelFindingsReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelFindingsReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelSbomExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelSbomExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCisScanConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCisScanConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFindingsReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFindingsReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSbomExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSbomExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCisScanConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCisScanConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOrganizationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOrganizationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Disable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableDelegatedAdminAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableDelegatedAdminAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateMemberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateMember(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Enable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableDelegatedAdminAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableDelegatedAdminAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCisScanReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCisScanReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCisScanResultDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCisScanResultDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDelegatedAdminAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDelegatedAdminAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEc2DeepInspectionConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEc2DeepInspectionConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEncryptionKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEncryptionKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFindingsReportStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFindingsReportStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMemberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMember(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSbomExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSbomExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccountPermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccountPermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCisScanConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCisScanConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCisScanResultsAggregatedByChecksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCisScanResultsAggregatedByChecks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCisScanResultsAggregatedByTargetResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCisScanResultsAggregatedByTargetResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCisScansSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCisScans(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCoverageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCoverage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCoverageStatisticsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCoverageStatistics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDelegatedAdminAccountsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDelegatedAdminAccounts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFiltersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFilters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFindingAggregationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFindingAggregations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFindingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFindings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUsageTotalsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUsageTotals(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetEncryptionKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetEncryptionKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchVulnerabilitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchVulnerabilities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendCisSessionHealthSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendCisSessionHealth(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendCisSessionTelemetrySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendCisSessionTelemetry(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartCisSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartCisSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopCisSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopCisSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCisScanConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCisScanConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEc2DeepInspectionConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEc2DeepInspectionConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEncryptionKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEncryptionKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateOrganizationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateOrganizationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateOrgEc2DeepInspectionConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateOrgEc2DeepInspectionConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/inspectorscan/generated.json b/service/inspectorscan/generated.json index d9a7e8b7824..45d17f0991d 100644 --- a/service/inspectorscan/generated.json +++ b/service/inspectorscan/generated.json @@ -26,6 +26,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/inspectorscan/sra_operation_order_test.go b/service/inspectorscan/sra_operation_order_test.go new file mode 100644 index 00000000000..77c2d48f46b --- /dev/null +++ b/service/inspectorscan/sra_operation_order_test.go @@ -0,0 +1,56 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package inspectorscan + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpScanSbomSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ScanSbom(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/internetmonitor/generated.json b/service/internetmonitor/generated.json index 2b6272e736c..f2cbf70ab87 100644 --- a/service/internetmonitor/generated.json +++ b/service/internetmonitor/generated.json @@ -37,6 +37,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/internetmonitor/sra_operation_order_test.go b/service/internetmonitor/sra_operation_order_test.go new file mode 100644 index 00000000000..ca878bb7266 --- /dev/null +++ b/service/internetmonitor/sra_operation_order_test.go @@ -0,0 +1,581 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package internetmonitor + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateMonitorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMonitor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMonitorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMonitor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetHealthEventSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetHealthEvent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInternetEventSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInternetEvent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMonitorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMonitor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQueryResultsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQueryResults(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQueryStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQueryStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListHealthEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListHealthEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInternetEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInternetEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMonitorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMonitors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMonitorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMonitor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/invoicing/generated.json b/service/invoicing/generated.json index a05bb37f3be..4deace8f3d1 100644 --- a/service/invoicing/generated.json +++ b/service/invoicing/generated.json @@ -30,6 +30,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/invoicing/sra_operation_order_test.go b/service/invoicing/sra_operation_order_test.go new file mode 100644 index 00000000000..97c99714fd3 --- /dev/null +++ b/service/invoicing/sra_operation_order_test.go @@ -0,0 +1,336 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package invoicing + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchGetInvoiceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetInvoiceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInvoiceUnitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInvoiceUnit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInvoiceUnitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInvoiceUnit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInvoiceUnitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInvoiceUnit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInvoiceUnitsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInvoiceUnits(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateInvoiceUnitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateInvoiceUnit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/iot/generated.json b/service/iot/generated.json index 04531a7e56c..209390042ea 100644 --- a/service/iot/generated.json +++ b/service/iot/generated.json @@ -291,6 +291,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/iot/sra_operation_order_test.go b/service/iot/sra_operation_order_test.go new file mode 100644 index 00000000000..53629e7103c --- /dev/null +++ b/service/iot/sra_operation_order_test.go @@ -0,0 +1,9471 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iot + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcceptCertificateTransferSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptCertificateTransfer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddThingToBillingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddThingToBillingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddThingToThingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddThingToThingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateSbomWithPackageVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateSbomWithPackageVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateTargetsWithJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateTargetsWithJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachPrincipalPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachPrincipalPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachSecurityProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachSecurityProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachThingPrincipalSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachThingPrincipal(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelAuditMitigationActionsTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelAuditMitigationActionsTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelAuditTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelAuditTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelCertificateTransferSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelCertificateTransfer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelDetectMitigationActionsTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelDetectMitigationActionsTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelJobExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelJobExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpClearDefaultAuthorizerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ClearDefaultAuthorizer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpConfirmTopicRuleDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ConfirmTopicRuleDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAuditSuppressionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAuditSuppression(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAuthorizerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAuthorizer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBillingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBillingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCertificateFromCsrSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCertificateFromCsr(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCertificateProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCertificateProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCommandSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCommand(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCustomMetricSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCustomMetric(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDimensionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDimension(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDomainConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDomainConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDynamicThingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDynamicThingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFleetMetricSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFleetMetric(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateJobTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateJobTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateKeysAndCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateKeysAndCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMitigationActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMitigationAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateOTAUpdateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateOTAUpdate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePackageVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePackageVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePolicyVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePolicyVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProvisioningClaimSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProvisioningClaim(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProvisioningTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProvisioningTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProvisioningTemplateVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProvisioningTemplateVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRoleAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRoleAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateScheduledAuditSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateScheduledAudit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSecurityProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSecurityProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateThingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateThing(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateThingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateThingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateThingTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateThingType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTopicRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTopicRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTopicRuleDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTopicRuleDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccountAuditConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccountAuditConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAuditSuppressionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAuditSuppression(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAuthorizerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAuthorizer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBillingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBillingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCACertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCACertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCertificateProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCertificateProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCommandSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCommand(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCommandExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCommandExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCustomMetricSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCustomMetric(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDimensionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDimension(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDomainConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDomainConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDynamicThingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDynamicThingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFleetMetricSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFleetMetric(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteJobExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteJobExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteJobTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteJobTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMitigationActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMitigationAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteOTAUpdateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteOTAUpdate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePackageVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePackageVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePolicyVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePolicyVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProvisioningTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProvisioningTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProvisioningTemplateVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProvisioningTemplateVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRegistrationCodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRegistrationCode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRoleAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRoleAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteScheduledAuditSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteScheduledAudit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSecurityProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSecurityProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteThingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteThing(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteThingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteThingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteThingTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteThingType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTopicRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTopicRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTopicRuleDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTopicRuleDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteV2LoggingLevelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteV2LoggingLevel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeprecateThingTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeprecateThingType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccountAuditConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccountAuditConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAuditFindingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAuditFinding(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAuditMitigationActionsTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAuditMitigationActionsTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAuditSuppressionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAuditSuppression(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAuditTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAuditTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAuthorizerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAuthorizer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBillingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBillingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCACertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCACertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCertificateProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCertificateProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCustomMetricSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCustomMetric(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDefaultAuthorizerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDefaultAuthorizer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDetectMitigationActionsTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDetectMitigationActionsTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDimensionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDimension(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDomainConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDomainConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEventConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFleetMetricSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFleetMetric(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIndexSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIndex(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeJobExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeJobExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeJobTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeJobTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeManagedJobTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeManagedJobTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMitigationActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMitigationAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeProvisioningTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeProvisioningTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeProvisioningTemplateVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeProvisioningTemplateVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRoleAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRoleAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeScheduledAuditSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeScheduledAudit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSecurityProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSecurityProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeThingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeThing(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeThingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeThingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeThingRegistrationTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeThingRegistrationTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeThingTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeThingType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachPrincipalPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachPrincipalPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachSecurityProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachSecurityProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachThingPrincipalSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachThingPrincipal(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableTopicRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableTopicRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateSbomFromPackageVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateSbomFromPackageVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableTopicRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableTopicRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBehaviorModelTrainingSummariesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBehaviorModelTrainingSummaries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketsAggregationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketsAggregation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCardinalitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCardinality(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCommandSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCommand(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCommandExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCommandExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEffectivePoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEffectivePolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIndexingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIndexingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetJobDocumentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetJobDocument(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLoggingOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLoggingOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOTAUpdateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOTAUpdate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPackageConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPackageConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPackageVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPackageVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPercentilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPercentiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPolicyVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPolicyVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRegistrationCodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRegistrationCode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStatisticsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStatistics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetThingConnectivityDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetThingConnectivityData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTopicRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTopicRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTopicRuleDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTopicRuleDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetV2LoggingOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetV2LoggingOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListActiveViolationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListActiveViolations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAttachedPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAttachedPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAuditFindingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAuditFindings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAuditMitigationActionsExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAuditMitigationActionsExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAuditMitigationActionsTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAuditMitigationActionsTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAuditSuppressionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAuditSuppressions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAuditTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAuditTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAuthorizersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAuthorizers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBillingGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBillingGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCACertificatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCACertificates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCertificateProvidersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCertificateProviders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCertificatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCertificates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCertificatesByCASRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCertificatesByCA(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCommandExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCommandExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCommandsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCommands(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCustomMetricsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCustomMetrics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDetectMitigationActionsExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDetectMitigationActionsExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDetectMitigationActionsTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDetectMitigationActionsTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDimensionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDimensions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDomainConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDomainConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFleetMetricsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFleetMetrics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIndicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIndices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJobExecutionsForJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJobExecutionsForJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJobExecutionsForThingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJobExecutionsForThing(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJobTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJobTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListManagedJobTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListManagedJobTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMetricValuesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMetricValues(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMitigationActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMitigationActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOTAUpdatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOTAUpdates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOutgoingCertificatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOutgoingCertificates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPackagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPackages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPackageVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPackageVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPolicyPrincipalsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPolicyPrincipals(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPolicyVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPolicyVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPrincipalPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPrincipalPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPrincipalThingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPrincipalThings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPrincipalThingsV2SRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPrincipalThingsV2(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProvisioningTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProvisioningTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProvisioningTemplateVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProvisioningTemplateVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRelatedResourcesForAuditFindingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRelatedResourcesForAuditFinding(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRoleAliasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRoleAliases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSbomValidationResultsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSbomValidationResults(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListScheduledAuditsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListScheduledAudits(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSecurityProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSecurityProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSecurityProfilesForTargetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSecurityProfilesForTarget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStreamsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStreams(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTargetsForPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTargetsForPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTargetsForSecurityProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTargetsForSecurityProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListThingGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListThingGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListThingGroupsForThingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListThingGroupsForThing(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListThingPrincipalsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListThingPrincipals(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListThingPrincipalsV2SRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListThingPrincipalsV2(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListThingRegistrationTaskReportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListThingRegistrationTaskReports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListThingRegistrationTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListThingRegistrationTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListThingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListThings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListThingsInBillingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListThingsInBillingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListThingsInThingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListThingsInThingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListThingTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListThingTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTopicRuleDestinationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTopicRuleDestinations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTopicRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTopicRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListV2LoggingLevelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListV2LoggingLevels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListViolationEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListViolationEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutVerificationStateOnViolationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutVerificationStateOnViolation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterCACertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterCACertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterCertificateWithoutCASRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterCertificateWithoutCA(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterThingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterThing(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRejectCertificateTransferSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RejectCertificateTransfer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveThingFromBillingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveThingFromBillingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveThingFromThingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveThingFromThingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReplaceTopicRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReplaceTopicRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchIndexSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchIndex(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetDefaultAuthorizerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetDefaultAuthorizer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetDefaultPolicyVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetDefaultPolicyVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetLoggingOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetLoggingOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetV2LoggingLevelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetV2LoggingLevel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetV2LoggingOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetV2LoggingOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartAuditMitigationActionsTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartAuditMitigationActionsTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDetectMitigationActionsTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDetectMitigationActionsTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartOnDemandAuditTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartOnDemandAuditTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartThingRegistrationTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartThingRegistrationTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopThingRegistrationTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopThingRegistrationTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestAuthorizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestAuthorization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestInvokeAuthorizerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestInvokeAuthorizer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTransferCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TransferCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAccountAuditConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAccountAuditConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAuditSuppressionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAuditSuppression(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAuthorizerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAuthorizer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBillingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBillingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCACertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCACertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCertificateProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCertificateProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCommandSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCommand(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCustomMetricSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCustomMetric(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDimensionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDimension(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDomainConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDomainConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDynamicThingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDynamicThingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEventConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEventConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFleetMetricSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFleetMetric(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIndexingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIndexingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMitigationActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMitigationAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePackageConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePackageConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePackageVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePackageVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProvisioningTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProvisioningTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRoleAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRoleAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateScheduledAuditSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateScheduledAudit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSecurityProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSecurityProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateThingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateThing(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateThingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateThingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateThingGroupsForThingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateThingGroupsForThing(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateThingTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateThingType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTopicRuleDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTopicRuleDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpValidateSecurityProfileBehaviorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ValidateSecurityProfileBehaviors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/iotanalytics/generated.json b/service/iotanalytics/generated.json index 22b7a9e0ff6..c4c77aeb77c 100644 --- a/service/iotanalytics/generated.json +++ b/service/iotanalytics/generated.json @@ -55,6 +55,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/iotanalytics/sra_operation_order_test.go b/service/iotanalytics/sra_operation_order_test.go new file mode 100644 index 00000000000..96d8f68257e --- /dev/null +++ b/service/iotanalytics/sra_operation_order_test.go @@ -0,0 +1,1211 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotanalytics + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchPutMessageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchPutMessage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelPipelineReprocessingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelPipelineReprocessing(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDatasetContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDatasetContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDatastoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDatastore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDatasetContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDatasetContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDatastoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDatastore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDatastoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDatastore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLoggingOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLoggingOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDatasetContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDatasetContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListChannelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListChannels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDatasetContentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDatasetContents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDatasetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDatasets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDatastoresSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDatastores(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPipelinesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPipelines(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutLoggingOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutLoggingOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRunPipelineActivitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RunPipelineActivity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSampleChannelDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SampleChannelData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartPipelineReprocessingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartPipelineReprocessing(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDatastoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDatastore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/iotdataplane/generated.json b/service/iotdataplane/generated.json index 0fe15b5f4e1..b3f93536b62 100644 --- a/service/iotdataplane/generated.json +++ b/service/iotdataplane/generated.json @@ -28,6 +28,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/iotdataplane/sra_operation_order_test.go b/service/iotdataplane/sra_operation_order_test.go new file mode 100644 index 00000000000..2f91d0cfc66 --- /dev/null +++ b/service/iotdataplane/sra_operation_order_test.go @@ -0,0 +1,266 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotdataplane + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpDeleteThingShadowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteThingShadow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRetainedMessageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRetainedMessage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetThingShadowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetThingShadow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNamedShadowsForThingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNamedShadowsForThing(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRetainedMessagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRetainedMessages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPublishSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Publish(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateThingShadowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateThingShadow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/iotdeviceadvisor/generated.json b/service/iotdeviceadvisor/generated.json index adb6fb00ea8..6323c942123 100644 --- a/service/iotdeviceadvisor/generated.json +++ b/service/iotdeviceadvisor/generated.json @@ -35,6 +35,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/iotdeviceadvisor/sra_operation_order_test.go b/service/iotdeviceadvisor/sra_operation_order_test.go new file mode 100644 index 00000000000..db8699ab6a0 --- /dev/null +++ b/service/iotdeviceadvisor/sra_operation_order_test.go @@ -0,0 +1,511 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotdeviceadvisor + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateSuiteDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSuiteDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSuiteDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSuiteDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSuiteDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSuiteDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSuiteRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSuiteRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSuiteRunReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSuiteRunReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSuiteDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSuiteDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSuiteRunsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSuiteRuns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartSuiteRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartSuiteRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopSuiteRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopSuiteRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSuiteDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSuiteDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/iotevents/generated.json b/service/iotevents/generated.json index a84ce25f43b..fe535502584 100644 --- a/service/iotevents/generated.json +++ b/service/iotevents/generated.json @@ -47,6 +47,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/iotevents/sra_operation_order_test.go b/service/iotevents/sra_operation_order_test.go new file mode 100644 index 00000000000..2e827505916 --- /dev/null +++ b/service/iotevents/sra_operation_order_test.go @@ -0,0 +1,931 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotevents + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateAlarmModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAlarmModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDetectorModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDetectorModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAlarmModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAlarmModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDetectorModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDetectorModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAlarmModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAlarmModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDetectorModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDetectorModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDetectorModelAnalysisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDetectorModelAnalysis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLoggingOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLoggingOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDetectorModelAnalysisResultsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDetectorModelAnalysisResults(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAlarmModelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAlarmModels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAlarmModelVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAlarmModelVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDetectorModelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDetectorModels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDetectorModelVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDetectorModelVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInputRoutingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInputRoutings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInputsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInputs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutLoggingOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutLoggingOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDetectorModelAnalysisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDetectorModelAnalysis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAlarmModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAlarmModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDetectorModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDetectorModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateInputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateInput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/ioteventsdata/generated.json b/service/ioteventsdata/generated.json index 1b575bcf080..aeef58c21b9 100644 --- a/service/ioteventsdata/generated.json +++ b/service/ioteventsdata/generated.json @@ -33,6 +33,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/ioteventsdata/sra_operation_order_test.go b/service/ioteventsdata/sra_operation_order_test.go new file mode 100644 index 00000000000..290460b83bf --- /dev/null +++ b/service/ioteventsdata/sra_operation_order_test.go @@ -0,0 +1,441 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ioteventsdata + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchAcknowledgeAlarmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchAcknowledgeAlarm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeleteDetectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteDetector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDisableAlarmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDisableAlarm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchEnableAlarmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchEnableAlarm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchPutMessageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchPutMessage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchResetAlarmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchResetAlarm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchSnoozeAlarmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchSnoozeAlarm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchUpdateDetectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchUpdateDetector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAlarmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAlarm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDetectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDetector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAlarmsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAlarms(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDetectorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDetectors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/iotfleethub/generated.json b/service/iotfleethub/generated.json index a53e053e428..7a785ca2d0a 100644 --- a/service/iotfleethub/generated.json +++ b/service/iotfleethub/generated.json @@ -29,6 +29,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/iotfleethub/sra_operation_order_test.go b/service/iotfleethub/sra_operation_order_test.go new file mode 100644 index 00000000000..0cae77eeecb --- /dev/null +++ b/service/iotfleethub/sra_operation_order_test.go @@ -0,0 +1,301 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotfleethub + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/iotfleetwise/generated.json b/service/iotfleetwise/generated.json index b1e2960010a..696d99aa177 100644 --- a/service/iotfleetwise/generated.json +++ b/service/iotfleetwise/generated.json @@ -78,6 +78,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/iotfleetwise/sra_operation_order_test.go b/service/iotfleetwise/sra_operation_order_test.go new file mode 100644 index 00000000000..a24b0be25a9 --- /dev/null +++ b/service/iotfleetwise/sra_operation_order_test.go @@ -0,0 +1,2016 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotfleetwise + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateVehicleFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateVehicleFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchCreateVehicleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchCreateVehicle(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchUpdateVehicleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchUpdateVehicle(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCampaignSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCampaign(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDecoderManifestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDecoderManifest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateModelManifestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateModelManifest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSignalCatalogSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSignalCatalog(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStateTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStateTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVehicleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVehicle(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCampaignSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCampaign(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDecoderManifestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDecoderManifest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteModelManifestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteModelManifest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSignalCatalogSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSignalCatalog(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteStateTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteStateTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVehicleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVehicle(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateVehicleFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateVehicleFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCampaignSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCampaign(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDecoderManifestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDecoderManifest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEncryptionConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEncryptionConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLoggingOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLoggingOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetModelManifestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetModelManifest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRegisterAccountStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRegisterAccountStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSignalCatalogSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSignalCatalog(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStateTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStateTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVehicleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVehicle(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVehicleStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVehicleStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportDecoderManifestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportDecoderManifest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportSignalCatalogSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportSignalCatalog(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCampaignsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCampaigns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDecoderManifestNetworkInterfacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDecoderManifestNetworkInterfaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDecoderManifestsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDecoderManifests(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDecoderManifestSignalsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDecoderManifestSignals(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFleetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFleets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFleetsForVehicleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFleetsForVehicle(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListModelManifestNodesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListModelManifestNodes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListModelManifestsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListModelManifests(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSignalCatalogNodesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSignalCatalogNodes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSignalCatalogsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSignalCatalogs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStateTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStateTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVehiclesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVehicles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVehiclesInFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVehiclesInFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutEncryptionConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutEncryptionConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutLoggingOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutLoggingOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCampaignSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCampaign(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDecoderManifestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDecoderManifest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateModelManifestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateModelManifest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSignalCatalogSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSignalCatalog(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateStateTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateStateTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVehicleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVehicle(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/iotjobsdataplane/generated.json b/service/iotjobsdataplane/generated.json index f4ea5365e3e..e4e32dd73e5 100644 --- a/service/iotjobsdataplane/generated.json +++ b/service/iotjobsdataplane/generated.json @@ -26,6 +26,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/iotjobsdataplane/sra_operation_order_test.go b/service/iotjobsdataplane/sra_operation_order_test.go new file mode 100644 index 00000000000..a68a3539397 --- /dev/null +++ b/service/iotjobsdataplane/sra_operation_order_test.go @@ -0,0 +1,196 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotjobsdataplane + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpDescribeJobExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeJobExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPendingJobExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPendingJobExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartCommandExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartCommandExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartNextPendingJobExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartNextPendingJobExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateJobExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateJobExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/iotsecuretunneling/generated.json b/service/iotsecuretunneling/generated.json index 05ec786e46b..78f76da7952 100644 --- a/service/iotsecuretunneling/generated.json +++ b/service/iotsecuretunneling/generated.json @@ -29,6 +29,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/iotsecuretunneling/sra_operation_order_test.go b/service/iotsecuretunneling/sra_operation_order_test.go new file mode 100644 index 00000000000..af2e1af6b35 --- /dev/null +++ b/service/iotsecuretunneling/sra_operation_order_test.go @@ -0,0 +1,301 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotsecuretunneling + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCloseTunnelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CloseTunnel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTunnelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTunnel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTunnelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTunnels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpOpenTunnelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.OpenTunnel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRotateTunnelAccessTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RotateTunnelAccessToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/iotsitewise/generated.json b/service/iotsitewise/generated.json index a89be8b1a10..73850b63f4e 100644 --- a/service/iotsitewise/generated.json +++ b/service/iotsitewise/generated.json @@ -113,6 +113,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/iotsitewise/sra_operation_order_test.go b/service/iotsitewise/sra_operation_order_test.go new file mode 100644 index 00000000000..d7116596660 --- /dev/null +++ b/service/iotsitewise/sra_operation_order_test.go @@ -0,0 +1,3171 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotsitewise + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateAssetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateAssets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateTimeSeriesToAssetPropertySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateTimeSeriesToAssetProperty(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchAssociateProjectAssetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchAssociateProjectAssets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDisassociateProjectAssetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDisassociateProjectAssets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetAssetPropertyAggregatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetAssetPropertyAggregates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetAssetPropertyValueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetAssetPropertyValue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetAssetPropertyValueHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetAssetPropertyValueHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchPutAssetPropertyValueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchPutAssetPropertyValue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAccessPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAccessPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAssetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAsset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAssetModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAssetModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAssetModelCompositeModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAssetModelCompositeModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBulkImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBulkImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDashboardSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDashboard(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePortalSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePortal(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccessPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccessPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAssetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAsset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAssetModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAssetModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAssetModelCompositeModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAssetModelCompositeModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDashboardSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDashboard(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePortalSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePortal(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTimeSeriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTimeSeries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccessPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccessPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAssetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAsset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAssetCompositeModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAssetCompositeModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAssetModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAssetModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAssetModelCompositeModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAssetModelCompositeModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAssetPropertySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAssetProperty(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBulkImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBulkImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDashboardSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDashboard(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDefaultEncryptionConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDefaultEncryptionConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGatewayCapabilityConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGatewayCapabilityConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLoggingOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLoggingOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePortalSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePortal(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStorageConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStorageConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTimeSeriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTimeSeries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateAssetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateAssets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateTimeSeriesFromAssetPropertySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateTimeSeriesFromAssetProperty(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExecuteActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExecuteAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExecuteQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExecuteQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAssetPropertyAggregatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAssetPropertyAggregates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAssetPropertyValueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAssetPropertyValue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAssetPropertyValueHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAssetPropertyValueHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInterpolatedAssetPropertyValuesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInterpolatedAssetPropertyValues(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInvokeAssistantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InvokeAssistant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccessPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccessPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssetModelCompositeModelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssetModelCompositeModels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssetModelPropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssetModelProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssetModelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssetModels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssetPropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssetProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssetRelationshipsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssetRelationships(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssociatedAssetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssociatedAssets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBulkImportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBulkImportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCompositionRelationshipsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCompositionRelationships(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDashboardsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDashboards(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDatasetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDatasets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGatewaysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGateways(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPortalsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPortals(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProjectAssetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProjectAssets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProjectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProjects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTimeSeriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTimeSeries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutDefaultEncryptionConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutDefaultEncryptionConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutLoggingOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutLoggingOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutStorageConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutStorageConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAccessPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAccessPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAssetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAsset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAssetModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAssetModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAssetModelCompositeModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAssetModelCompositeModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAssetPropertySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAssetProperty(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDashboardSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDashboard(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGatewayCapabilityConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGatewayCapabilityConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePortalSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePortal(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/iotthingsgraph/generated.json b/service/iotthingsgraph/generated.json index 759d7500d08..2b42df94af5 100644 --- a/service/iotthingsgraph/generated.json +++ b/service/iotthingsgraph/generated.json @@ -56,6 +56,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/iotthingsgraph/sra_operation_order_test.go b/service/iotthingsgraph/sra_operation_order_test.go new file mode 100644 index 00000000000..d50d4342086 --- /dev/null +++ b/service/iotthingsgraph/sra_operation_order_test.go @@ -0,0 +1,1246 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotthingsgraph + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateEntityToThingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateEntityToThing(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFlowTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFlowTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSystemInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSystemInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSystemTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSystemTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFlowTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFlowTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSystemInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSystemInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSystemTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSystemTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeploySystemInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeploySystemInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeprecateFlowTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeprecateFlowTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeprecateSystemTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeprecateSystemTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDissociateEntityFromThingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DissociateEntityFromThing(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEntitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEntities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFlowTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFlowTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFlowTemplateRevisionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFlowTemplateRevisions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetNamespaceDeletionStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetNamespaceDeletionStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSystemInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSystemInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSystemTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSystemTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSystemTemplateRevisionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSystemTemplateRevisions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUploadStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUploadStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFlowExecutionMessagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFlowExecutionMessages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchEntitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchEntities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchFlowExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchFlowExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchFlowTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchFlowTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchSystemInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchSystemInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchSystemTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchSystemTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchThingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchThings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUndeploySystemInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UndeploySystemInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFlowTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFlowTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSystemTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSystemTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUploadEntityDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UploadEntityDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/iottwinmaker/generated.json b/service/iottwinmaker/generated.json index d9a8383ae90..42a2233ce68 100644 --- a/service/iottwinmaker/generated.json +++ b/service/iottwinmaker/generated.json @@ -65,6 +65,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/iottwinmaker/sra_operation_order_test.go b/service/iottwinmaker/sra_operation_order_test.go new file mode 100644 index 00000000000..802f561d98d --- /dev/null +++ b/service/iottwinmaker/sra_operation_order_test.go @@ -0,0 +1,1421 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iottwinmaker + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchPutPropertyValuesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchPutPropertyValues(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelMetadataTransferJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelMetadataTransferJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateComponentTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateComponentType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEntitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEntity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMetadataTransferJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMetadataTransferJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSceneSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateScene(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSyncJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSyncJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorkspaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorkspace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteComponentTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteComponentType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEntitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEntity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSceneSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteScene(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSyncJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSyncJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWorkspaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWorkspace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExecuteQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExecuteQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetComponentTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetComponentType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEntitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEntity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMetadataTransferJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMetadataTransferJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPricingPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPricingPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPropertyValueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPropertyValue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPropertyValueHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPropertyValueHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSceneSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetScene(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSyncJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSyncJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWorkspaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWorkspace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListComponentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListComponents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListComponentTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListComponentTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEntitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEntities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMetadataTransferJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMetadataTransferJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListScenesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListScenes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSyncJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSyncJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSyncResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSyncResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkspacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkspaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateComponentTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateComponentType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEntitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEntity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePricingPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePricingPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSceneSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateScene(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWorkspaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWorkspace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/iotwireless/generated.json b/service/iotwireless/generated.json index a5bb263444b..9d5d694d666 100644 --- a/service/iotwireless/generated.json +++ b/service/iotwireless/generated.json @@ -133,6 +133,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/iotwireless/sra_operation_order_test.go b/service/iotwireless/sra_operation_order_test.go new file mode 100644 index 00000000000..b3ab5eeb385 --- /dev/null +++ b/service/iotwireless/sra_operation_order_test.go @@ -0,0 +1,3941 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateAwsAccountWithPartnerAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateAwsAccountWithPartnerAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateMulticastGroupWithFuotaTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateMulticastGroupWithFuotaTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateWirelessDeviceWithFuotaTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateWirelessDeviceWithFuotaTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateWirelessDeviceWithMulticastGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateWirelessDeviceWithMulticastGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateWirelessDeviceWithThingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateWirelessDeviceWithThing(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateWirelessGatewayWithCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateWirelessGatewayWithCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateWirelessGatewayWithThingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateWirelessGatewayWithThing(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelMulticastGroupSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelMulticastGroupSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDeviceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDeviceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFuotaTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFuotaTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMulticastGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMulticastGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateNetworkAnalyzerConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNetworkAnalyzerConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateServiceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateServiceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWirelessDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWirelessDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWirelessGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWirelessGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWirelessGatewayTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWirelessGatewayTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWirelessGatewayTaskDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWirelessGatewayTaskDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDeviceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDeviceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFuotaTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFuotaTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMulticastGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMulticastGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNetworkAnalyzerConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNetworkAnalyzerConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteQueuedMessagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteQueuedMessages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteServiceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteServiceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWirelessDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWirelessDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWirelessDeviceImportTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWirelessDeviceImportTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWirelessGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWirelessGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWirelessGatewayTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWirelessGatewayTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWirelessGatewayTaskDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWirelessGatewayTaskDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterWirelessDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterWirelessDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateAwsAccountFromPartnerAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateAwsAccountFromPartnerAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateMulticastGroupFromFuotaTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateMulticastGroupFromFuotaTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateWirelessDeviceFromFuotaTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateWirelessDeviceFromFuotaTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateWirelessDeviceFromMulticastGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateWirelessDeviceFromMulticastGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateWirelessDeviceFromThingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateWirelessDeviceFromThing(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateWirelessGatewayFromCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateWirelessGatewayFromCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateWirelessGatewayFromThingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateWirelessGatewayFromThing(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeviceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeviceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEventConfigurationByResourceTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEventConfigurationByResourceTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFuotaTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFuotaTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLogLevelsByResourceTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLogLevelsByResourceTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMetricConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMetricConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMetricsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMetrics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMulticastGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMulticastGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMulticastGroupSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMulticastGroupSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetNetworkAnalyzerConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetNetworkAnalyzerConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPartnerAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPartnerAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPositionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPosition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPositionConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPositionConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPositionEstimateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPositionEstimate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourceEventConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourceEventConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourceLogLevelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourceLogLevel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourcePositionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourcePosition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServiceEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServiceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWirelessDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWirelessDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWirelessDeviceImportTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWirelessDeviceImportTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWirelessDeviceStatisticsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWirelessDeviceStatistics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWirelessGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWirelessGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWirelessGatewayCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWirelessGatewayCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWirelessGatewayFirmwareInformationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWirelessGatewayFirmwareInformation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWirelessGatewayStatisticsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWirelessGatewayStatistics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWirelessGatewayTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWirelessGatewayTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWirelessGatewayTaskDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWirelessGatewayTaskDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDestinationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDestinations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDeviceProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDeviceProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDevicesForWirelessDeviceImportTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDevicesForWirelessDeviceImportTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEventConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEventConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFuotaTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFuotaTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMulticastGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMulticastGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMulticastGroupsByFuotaTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMulticastGroupsByFuotaTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNetworkAnalyzerConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNetworkAnalyzerConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPartnerAccountsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPartnerAccounts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPositionConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPositionConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListQueuedMessagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListQueuedMessages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServiceProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServiceProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWirelessDeviceImportTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWirelessDeviceImportTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWirelessDevicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWirelessDevices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWirelessGatewaysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWirelessGateways(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWirelessGatewayTaskDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWirelessGatewayTaskDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutPositionConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutPositionConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResourceLogLevelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResourceLogLevel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetAllResourceLogLevelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetAllResourceLogLevels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetResourceLogLevelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetResourceLogLevel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendDataToMulticastGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendDataToMulticastGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendDataToWirelessDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendDataToWirelessDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartBulkAssociateWirelessDeviceWithMulticastGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartBulkAssociateWirelessDeviceWithMulticastGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartBulkDisassociateWirelessDeviceFromMulticastGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartBulkDisassociateWirelessDeviceFromMulticastGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartFuotaTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartFuotaTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMulticastGroupSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMulticastGroupSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartSingleWirelessDeviceImportTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartSingleWirelessDeviceImportTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartWirelessDeviceImportTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartWirelessDeviceImportTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestWirelessDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestWirelessDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEventConfigurationByResourceTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEventConfigurationByResourceTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFuotaTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFuotaTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLogLevelsByResourceTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLogLevelsByResourceTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMetricConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMetricConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMulticastGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMulticastGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateNetworkAnalyzerConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateNetworkAnalyzerConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePartnerAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePartnerAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePositionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePosition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateResourceEventConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateResourceEventConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateResourcePositionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateResourcePosition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWirelessDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWirelessDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWirelessDeviceImportTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWirelessDeviceImportTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWirelessGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWirelessGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/ivs/generated.json b/service/ivs/generated.json index cfe0f0b4eac..065885305a0 100644 --- a/service/ivs/generated.json +++ b/service/ivs/generated.json @@ -56,6 +56,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/ivs/sra_operation_order_test.go b/service/ivs/sra_operation_order_test.go new file mode 100644 index 00000000000..cf65b22edeb --- /dev/null +++ b/service/ivs/sra_operation_order_test.go @@ -0,0 +1,1246 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ivs + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchGetChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetStreamKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetStreamKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchStartViewerSessionRevocationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchStartViewerSessionRevocation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePlaybackRestrictionPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePlaybackRestrictionPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRecordingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRecordingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStreamKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStreamKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePlaybackKeyPairSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePlaybackKeyPair(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePlaybackRestrictionPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePlaybackRestrictionPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRecordingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRecordingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteStreamKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteStreamKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPlaybackKeyPairSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPlaybackKeyPair(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPlaybackRestrictionPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPlaybackRestrictionPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRecordingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRecordingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStreamKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStreamKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStreamSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStreamSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportPlaybackKeyPairSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportPlaybackKeyPair(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListChannelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListChannels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPlaybackKeyPairsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPlaybackKeyPairs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPlaybackRestrictionPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPlaybackRestrictionPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRecordingConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRecordingConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStreamKeysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStreamKeys(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStreamsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStreams(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStreamSessionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStreamSessions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartViewerSessionRevocationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartViewerSessionRevocation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePlaybackRestrictionPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePlaybackRestrictionPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/ivschat/generated.json b/service/ivschat/generated.json index 5813bdce3b3..f33d66bd418 100644 --- a/service/ivschat/generated.json +++ b/service/ivschat/generated.json @@ -38,6 +38,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/ivschat/sra_operation_order_test.go b/service/ivschat/sra_operation_order_test.go new file mode 100644 index 00000000000..ca6cacbedef --- /dev/null +++ b/service/ivschat/sra_operation_order_test.go @@ -0,0 +1,616 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ivschat + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateChatTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateChatToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLoggingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLoggingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRoomSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRoom(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLoggingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLoggingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMessageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMessage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRoomSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRoom(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisconnectUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisconnectUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLoggingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLoggingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRoomSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRoom(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLoggingConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLoggingConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRoomsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRooms(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendEventSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendEvent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLoggingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLoggingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRoomSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRoom(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/ivsrealtime/generated.json b/service/ivsrealtime/generated.json index d66fcfc5bc9..e14c7fa228c 100644 --- a/service/ivsrealtime/generated.json +++ b/service/ivsrealtime/generated.json @@ -57,6 +57,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/ivsrealtime/sra_operation_order_test.go b/service/ivsrealtime/sra_operation_order_test.go new file mode 100644 index 00000000000..2ef07f485aa --- /dev/null +++ b/service/ivsrealtime/sra_operation_order_test.go @@ -0,0 +1,1281 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ivsrealtime + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateEncoderConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEncoderConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIngestConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIngestConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateParticipantTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateParticipantToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStorageConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStorageConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEncoderConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEncoderConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIngestConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIngestConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePublicKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePublicKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteStageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteStage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteStorageConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteStorageConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisconnectParticipantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisconnectParticipant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCompositionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetComposition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEncoderConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEncoderConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIngestConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIngestConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetParticipantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetParticipant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPublicKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPublicKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStageSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStageSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStorageConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStorageConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportPublicKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportPublicKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCompositionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCompositions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEncoderConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEncoderConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIngestConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIngestConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListParticipantEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListParticipantEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListParticipantsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListParticipants(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPublicKeysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPublicKeys(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStageSessionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStageSessions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStorageConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStorageConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartCompositionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartComposition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopCompositionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopComposition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIngestConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIngestConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateStageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateStage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/kafka/generated.json b/service/kafka/generated.json index a9a123c715b..08e525fcab0 100644 --- a/service/kafka/generated.json +++ b/service/kafka/generated.json @@ -73,6 +73,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/kafka/sra_operation_order_test.go b/service/kafka/sra_operation_order_test.go new file mode 100644 index 00000000000..34d47ba36c6 --- /dev/null +++ b/service/kafka/sra_operation_order_test.go @@ -0,0 +1,1841 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package kafka + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchAssociateScramSecretSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchAssociateScramSecret(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDisassociateScramSecretSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDisassociateScramSecret(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateClusterV2SRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateClusterV2(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateReplicatorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateReplicator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVpcConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVpcConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteClusterPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteClusterPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteReplicatorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteReplicator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVpcConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVpcConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClusterOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeClusterOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClusterOperationV2SRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeClusterOperationV2(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClusterV2SRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeClusterV2(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConfigurationRevisionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConfigurationRevision(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReplicatorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReplicator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVpcConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVpcConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBootstrapBrokersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBootstrapBrokers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetClusterPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetClusterPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCompatibleKafkaVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCompatibleKafkaVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListClientVpcConnectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListClientVpcConnections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListClusterOperationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListClusterOperations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListClusterOperationsV2SRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListClusterOperationsV2(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListClustersV2SRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListClustersV2(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConfigurationRevisionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConfigurationRevisions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListKafkaVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListKafkaVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNodesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNodes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReplicatorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReplicators(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListScramSecretsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListScramSecrets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVpcConnectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVpcConnections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutClusterPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutClusterPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRebootBrokerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RebootBroker(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRejectClientVpcConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RejectClientVpcConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBrokerCountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBrokerCount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBrokerStorageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBrokerStorage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBrokerTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBrokerType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateClusterConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateClusterConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateClusterKafkaVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateClusterKafkaVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConnectivitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConnectivity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMonitoringSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMonitoring(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateReplicationInfoSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateReplicationInfo(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSecuritySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSecurity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateStorageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateStorage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/kafkaconnect/generated.json b/service/kafkaconnect/generated.json index 8cbef3322f3..f988b63228c 100644 --- a/service/kafkaconnect/generated.json +++ b/service/kafkaconnect/generated.json @@ -39,6 +39,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/kafkaconnect/sra_operation_order_test.go b/service/kafkaconnect/sra_operation_order_test.go new file mode 100644 index 00000000000..da981972506 --- /dev/null +++ b/service/kafkaconnect/sra_operation_order_test.go @@ -0,0 +1,651 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package kafkaconnect + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCustomPluginSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCustomPlugin(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorkerConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorkerConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCustomPluginSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCustomPlugin(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWorkerConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWorkerConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConnectorOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConnectorOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCustomPluginSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCustomPlugin(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWorkerConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWorkerConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConnectorOperationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConnectorOperations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConnectorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConnectors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCustomPluginsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCustomPlugins(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkerConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkerConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/kendra/generated.json b/service/kendra/generated.json index ec42ab2c9e6..d2a0dec08f7 100644 --- a/service/kendra/generated.json +++ b/service/kendra/generated.json @@ -91,6 +91,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/kendra/sra_operation_order_test.go b/service/kendra/sra_operation_order_test.go new file mode 100644 index 00000000000..7b77ac134d9 --- /dev/null +++ b/service/kendra/sra_operation_order_test.go @@ -0,0 +1,2331 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package kendra + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateEntitiesToExperienceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateEntitiesToExperience(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociatePersonasToEntitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociatePersonasToEntities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeleteDocumentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteDocument(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeleteFeaturedResultsSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteFeaturedResultsSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetDocumentStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetDocumentStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchPutDocumentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchPutDocument(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpClearQuerySuggestionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ClearQuerySuggestions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAccessControlConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAccessControlConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateExperienceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateExperience(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFaqSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFaq(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFeaturedResultsSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFeaturedResultsSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIndexSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIndex(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateQuerySuggestionsBlockListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateQuerySuggestionsBlockList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateThesaurusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateThesaurus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccessControlConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccessControlConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteExperienceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteExperience(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFaqSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFaq(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIndexSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIndex(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePrincipalMappingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePrincipalMapping(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteQuerySuggestionsBlockListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteQuerySuggestionsBlockList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteThesaurusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteThesaurus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccessControlConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccessControlConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeExperienceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeExperience(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFaqSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFaq(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFeaturedResultsSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFeaturedResultsSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIndexSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIndex(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePrincipalMappingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePrincipalMapping(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeQuerySuggestionsBlockListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeQuerySuggestionsBlockList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeQuerySuggestionsConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeQuerySuggestionsConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeThesaurusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeThesaurus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateEntitiesFromExperienceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateEntitiesFromExperience(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociatePersonasFromEntitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociatePersonasFromEntities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQuerySuggestionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQuerySuggestions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSnapshotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSnapshots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccessControlConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccessControlConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataSourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataSources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataSourceSyncJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataSourceSyncJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEntityPersonasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEntityPersonas(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListExperienceEntitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListExperienceEntities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListExperiencesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListExperiences(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFaqsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFaqs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFeaturedResultsSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFeaturedResultsSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGroupsOlderThanOrderingIdSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGroupsOlderThanOrderingId(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIndicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIndices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListQuerySuggestionsBlockListsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListQuerySuggestionsBlockLists(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListThesauriSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListThesauri(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutPrincipalMappingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutPrincipalMapping(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Query(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRetrieveSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Retrieve(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDataSourceSyncJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDataSourceSyncJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopDataSourceSyncJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopDataSourceSyncJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSubmitFeedbackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SubmitFeedback(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAccessControlConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAccessControlConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateExperienceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateExperience(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFeaturedResultsSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFeaturedResultsSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIndexSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIndex(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateQuerySuggestionsBlockListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateQuerySuggestionsBlockList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateQuerySuggestionsConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateQuerySuggestionsConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateThesaurusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateThesaurus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/kendraranking/generated.json b/service/kendraranking/generated.json index 2489e0d4f6b..b8bcaa1be3a 100644 --- a/service/kendraranking/generated.json +++ b/service/kendraranking/generated.json @@ -30,6 +30,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/kendraranking/sra_operation_order_test.go b/service/kendraranking/sra_operation_order_test.go new file mode 100644 index 00000000000..c46e092e874 --- /dev/null +++ b/service/kendraranking/sra_operation_order_test.go @@ -0,0 +1,336 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package kendraranking + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateRescoreExecutionPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRescoreExecutionPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRescoreExecutionPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRescoreExecutionPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRescoreExecutionPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRescoreExecutionPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRescoreExecutionPlansSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRescoreExecutionPlans(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRescoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Rescore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRescoreExecutionPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRescoreExecutionPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/keyspaces/generated.json b/service/keyspaces/generated.json index 0f8481cabb9..3a1fe4b8c44 100644 --- a/service/keyspaces/generated.json +++ b/service/keyspaces/generated.json @@ -40,6 +40,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/keyspaces/sra_operation_order_test.go b/service/keyspaces/sra_operation_order_test.go new file mode 100644 index 00000000000..27354105c45 --- /dev/null +++ b/service/keyspaces/sra_operation_order_test.go @@ -0,0 +1,686 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package keyspaces + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateKeyspaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateKeyspace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteKeyspaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteKeyspace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetKeyspaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetKeyspace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTableAutoScalingSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTableAutoScalingSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListKeyspacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListKeyspaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTablesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTables(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateKeyspaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateKeyspace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/kinesis/generated.json b/service/kinesis/generated.json index 099978f19f6..beb1649dc6c 100644 --- a/service/kinesis/generated.json +++ b/service/kinesis/generated.json @@ -55,6 +55,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/kinesis/sra_operation_order_test.go b/service/kinesis/sra_operation_order_test.go new file mode 100644 index 00000000000..191e3b8b504 --- /dev/null +++ b/service/kinesis/sra_operation_order_test.go @@ -0,0 +1,1141 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package kinesis + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddTagsToStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddTagsToStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDecreaseStreamRetentionPeriodSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DecreaseStreamRetentionPeriod(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterStreamConsumerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterStreamConsumer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLimitsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLimits(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStreamConsumerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStreamConsumer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStreamSummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStreamSummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableEnhancedMonitoringSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableEnhancedMonitoring(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableEnhancedMonitoringSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableEnhancedMonitoring(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRecordsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRecords(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetShardIteratorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetShardIterator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpIncreaseStreamRetentionPeriodSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.IncreaseStreamRetentionPeriod(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListShardsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListShards(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStreamConsumersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStreamConsumers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStreamsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStreams(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMergeShardsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MergeShards(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRecordSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRecord(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRecordsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRecords(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterStreamConsumerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterStreamConsumer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveTagsFromStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveTagsFromStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSplitShardSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SplitShard(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartStreamEncryptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartStreamEncryption(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopStreamEncryptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopStreamEncryption(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSubscribeToShardSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SubscribeToShard(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateShardCountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateShardCount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateStreamModeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateStreamMode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/kinesisanalytics/generated.json b/service/kinesisanalytics/generated.json index 8ac46b3df4d..002302e7143 100644 --- a/service/kinesisanalytics/generated.json +++ b/service/kinesisanalytics/generated.json @@ -41,6 +41,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/kinesisanalytics/sra_operation_order_test.go b/service/kinesisanalytics/sra_operation_order_test.go new file mode 100644 index 00000000000..144c87d2276 --- /dev/null +++ b/service/kinesisanalytics/sra_operation_order_test.go @@ -0,0 +1,721 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package kinesisanalytics + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddApplicationCloudWatchLoggingOptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddApplicationCloudWatchLoggingOption(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddApplicationInputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddApplicationInput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddApplicationInputProcessingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddApplicationInputProcessingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddApplicationOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddApplicationOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddApplicationReferenceDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddApplicationReferenceDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationCloudWatchLoggingOptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplicationCloudWatchLoggingOption(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationInputProcessingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplicationInputProcessingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplicationOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationReferenceDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplicationReferenceDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDiscoverInputSchemaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DiscoverInputSchema(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/kinesisanalyticsv2/generated.json b/service/kinesisanalyticsv2/generated.json index db6205afc25..eba92afe735 100644 --- a/service/kinesisanalyticsv2/generated.json +++ b/service/kinesisanalyticsv2/generated.json @@ -54,6 +54,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/kinesisanalyticsv2/sra_operation_order_test.go b/service/kinesisanalyticsv2/sra_operation_order_test.go new file mode 100644 index 00000000000..225ccd04f86 --- /dev/null +++ b/service/kinesisanalyticsv2/sra_operation_order_test.go @@ -0,0 +1,1176 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package kinesisanalyticsv2 + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddApplicationCloudWatchLoggingOptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddApplicationCloudWatchLoggingOption(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddApplicationInputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddApplicationInput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddApplicationInputProcessingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddApplicationInputProcessingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddApplicationOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddApplicationOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddApplicationReferenceDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddApplicationReferenceDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddApplicationVpcConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddApplicationVpcConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateApplicationPresignedUrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApplicationPresignedUrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateApplicationSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApplicationSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationCloudWatchLoggingOptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplicationCloudWatchLoggingOption(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationInputProcessingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplicationInputProcessingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplicationOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationReferenceDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplicationReferenceDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplicationSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationVpcConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplicationVpcConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeApplicationOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeApplicationOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeApplicationSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeApplicationSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeApplicationVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeApplicationVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDiscoverInputSchemaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DiscoverInputSchema(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationOperationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplicationOperations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationSnapshotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplicationSnapshots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplicationVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRollbackApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RollbackApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApplicationMaintenanceConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApplicationMaintenanceConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/kinesisvideo/generated.json b/service/kinesisvideo/generated.json index 60be3cd290e..b4c42b324dc 100644 --- a/service/kinesisvideo/generated.json +++ b/service/kinesisvideo/generated.json @@ -51,6 +51,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/kinesisvideo/sra_operation_order_test.go b/service/kinesisvideo/sra_operation_order_test.go new file mode 100644 index 00000000000..54918a27841 --- /dev/null +++ b/service/kinesisvideo/sra_operation_order_test.go @@ -0,0 +1,1071 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package kinesisvideo + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateSignalingChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSignalingChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEdgeConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEdgeConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSignalingChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSignalingChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEdgeConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEdgeConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeImageGenerationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeImageGenerationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMappedResourceConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMappedResourceConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMediaStorageConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMediaStorageConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeNotificationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeNotificationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSignalingChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSignalingChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSignalingChannelEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSignalingChannelEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEdgeAgentConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEdgeAgentConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSignalingChannelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSignalingChannels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStreamsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStreams(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartEdgeConfigurationUpdateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartEdgeConfigurationUpdate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDataRetentionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataRetention(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateImageGenerationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateImageGenerationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMediaStorageConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMediaStorageConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateNotificationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateNotificationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSignalingChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSignalingChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/kinesisvideoarchivedmedia/generated.json b/service/kinesisvideoarchivedmedia/generated.json index c0a093de5b0..10bb2f71f15 100644 --- a/service/kinesisvideoarchivedmedia/generated.json +++ b/service/kinesisvideoarchivedmedia/generated.json @@ -27,6 +27,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/kinesisvideoarchivedmedia/sra_operation_order_test.go b/service/kinesisvideoarchivedmedia/sra_operation_order_test.go new file mode 100644 index 00000000000..f1779ca7acb --- /dev/null +++ b/service/kinesisvideoarchivedmedia/sra_operation_order_test.go @@ -0,0 +1,231 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package kinesisvideoarchivedmedia + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpGetClipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetClip(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDASHStreamingSessionURLSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDASHStreamingSessionURL(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetHLSStreamingSessionURLSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetHLSStreamingSessionURL(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetImagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetImages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMediaForFragmentListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMediaForFragmentList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFragmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFragments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/kinesisvideomedia/generated.json b/service/kinesisvideomedia/generated.json index dcb5cd0ddac..832a06d9978 100644 --- a/service/kinesisvideomedia/generated.json +++ b/service/kinesisvideomedia/generated.json @@ -22,6 +22,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/kinesisvideomedia/sra_operation_order_test.go b/service/kinesisvideomedia/sra_operation_order_test.go new file mode 100644 index 00000000000..8134d7ead84 --- /dev/null +++ b/service/kinesisvideomedia/sra_operation_order_test.go @@ -0,0 +1,56 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package kinesisvideomedia + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpGetMediaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMedia(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/kinesisvideosignaling/generated.json b/service/kinesisvideosignaling/generated.json index bdc76834b2b..1a86e923fe9 100644 --- a/service/kinesisvideosignaling/generated.json +++ b/service/kinesisvideosignaling/generated.json @@ -23,6 +23,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/kinesisvideosignaling/sra_operation_order_test.go b/service/kinesisvideosignaling/sra_operation_order_test.go new file mode 100644 index 00000000000..3e642be4549 --- /dev/null +++ b/service/kinesisvideosignaling/sra_operation_order_test.go @@ -0,0 +1,91 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package kinesisvideosignaling + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpGetIceServerConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIceServerConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendAlexaOfferToMasterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendAlexaOfferToMaster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/kinesisvideowebrtcstorage/generated.json b/service/kinesisvideowebrtcstorage/generated.json index 3d85aa8bc96..bf290721335 100644 --- a/service/kinesisvideowebrtcstorage/generated.json +++ b/service/kinesisvideowebrtcstorage/generated.json @@ -23,6 +23,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/errors.go", "types/types.go", "validators.go" diff --git a/service/kinesisvideowebrtcstorage/sra_operation_order_test.go b/service/kinesisvideowebrtcstorage/sra_operation_order_test.go new file mode 100644 index 00000000000..53282e0c0a8 --- /dev/null +++ b/service/kinesisvideowebrtcstorage/sra_operation_order_test.go @@ -0,0 +1,91 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package kinesisvideowebrtcstorage + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpJoinStorageSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.JoinStorageSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpJoinStorageSessionAsViewerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.JoinStorageSessionAsViewer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/kms/generated.json b/service/kms/generated.json index 57f79b4bf50..e1b7c153afa 100644 --- a/service/kms/generated.json +++ b/service/kms/generated.json @@ -74,6 +74,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/kms/sra_operation_order_test.go b/service/kms/sra_operation_order_test.go new file mode 100644 index 00000000000..f50c0437b37 --- /dev/null +++ b/service/kms/sra_operation_order_test.go @@ -0,0 +1,1876 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package kms + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCancelKeyDeletionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelKeyDeletion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpConnectCustomKeyStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ConnectCustomKeyStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCustomKeyStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCustomKeyStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGrantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGrant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDecryptSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Decrypt(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCustomKeyStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCustomKeyStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteImportedKeyMaterialSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteImportedKeyMaterial(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeriveSharedSecretSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeriveSharedSecret(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCustomKeyStoresSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCustomKeyStores(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableKeyRotationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableKeyRotation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisconnectCustomKeyStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisconnectCustomKeyStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableKeyRotationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableKeyRotation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEncryptSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Encrypt(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGenerateDataKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GenerateDataKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGenerateDataKeyPairSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GenerateDataKeyPair(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGenerateDataKeyPairWithoutPlaintextSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GenerateDataKeyPairWithoutPlaintext(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGenerateDataKeyWithoutPlaintextSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GenerateDataKeyWithoutPlaintext(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGenerateMacSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GenerateMac(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGenerateRandomSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GenerateRandom(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetKeyPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetKeyPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetKeyRotationStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetKeyRotationStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetParametersForImportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetParametersForImport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPublicKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPublicKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportKeyMaterialSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportKeyMaterial(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAliasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAliases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGrantsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGrants(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListKeyPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListKeyPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListKeyRotationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListKeyRotations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListKeysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListKeys(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRetirableGrantsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRetirableGrants(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutKeyPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutKeyPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReEncryptSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReEncrypt(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReplicateKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReplicateKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRetireGrantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RetireGrant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRevokeGrantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RevokeGrant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRotateKeyOnDemandSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RotateKeyOnDemand(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpScheduleKeyDeletionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ScheduleKeyDeletion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSignSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Sign(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCustomKeyStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCustomKeyStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateKeyDescriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateKeyDescription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePrimaryRegionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePrimaryRegion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpVerifySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Verify(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpVerifyMacSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.VerifyMac(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/lakeformation/generated.json b/service/lakeformation/generated.json index 817e9528f94..4572b29e02f 100644 --- a/service/lakeformation/generated.json +++ b/service/lakeformation/generated.json @@ -81,6 +81,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/lakeformation/sra_operation_order_test.go b/service/lakeformation/sra_operation_order_test.go new file mode 100644 index 00000000000..24da6439ed7 --- /dev/null +++ b/service/lakeformation/sra_operation_order_test.go @@ -0,0 +1,2121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lakeformation + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddLFTagsToResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddLFTagsToResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssumeDecoratedRoleWithSAMLSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssumeDecoratedRoleWithSAML(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGrantPermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGrantPermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchRevokePermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchRevokePermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelTransactionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelTransaction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCommitTransactionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CommitTransaction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataCellsFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataCellsFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLakeFormationIdentityCenterConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLakeFormationIdentityCenterConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLakeFormationOptInSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLakeFormationOptIn(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLFTagSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLFTag(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLFTagExpressionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLFTagExpression(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataCellsFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataCellsFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLakeFormationIdentityCenterConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLakeFormationIdentityCenterConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLakeFormationOptInSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLakeFormationOptIn(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLFTagSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLFTag(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLFTagExpressionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLFTagExpression(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteObjectsOnCancelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteObjectsOnCancel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLakeFormationIdentityCenterConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLakeFormationIdentityCenterConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTransactionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTransaction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExtendTransactionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExtendTransaction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataCellsFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataCellsFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataLakePrincipalSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataLakePrincipal(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataLakeSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataLakeSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEffectivePermissionsForPathSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEffectivePermissionsForPath(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLFTagSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLFTag(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLFTagExpressionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLFTagExpression(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQueryStateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQueryState(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQueryStatisticsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQueryStatistics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourceLFTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourceLFTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTableObjectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTableObjects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTemporaryGluePartitionCredentialsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTemporaryGluePartitionCredentials(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTemporaryGlueTableCredentialsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTemporaryGlueTableCredentials(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWorkUnitResultsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWorkUnitResults(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWorkUnitsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWorkUnits(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGrantPermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GrantPermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataCellsFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataCellsFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLakeFormationOptInsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLakeFormationOptIns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLFTagExpressionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLFTagExpressions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLFTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLFTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTableStorageOptimizersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTableStorageOptimizers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTransactionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTransactions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutDataLakeSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutDataLakeSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveLFTagsFromResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveLFTagsFromResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRevokePermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RevokePermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchDatabasesByLFTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchDatabasesByLFTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchTablesByLFTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchTablesByLFTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartQueryPlanningSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartQueryPlanning(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartTransactionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartTransaction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDataCellsFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataCellsFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLakeFormationIdentityCenterConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLakeFormationIdentityCenterConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLFTagSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLFTag(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLFTagExpressionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLFTagExpression(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTableObjectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTableObjects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTableStorageOptimizerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTableStorageOptimizer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/lambda/generated.json b/service/lambda/generated.json index ec015478dc5..9350ce58109 100644 --- a/service/lambda/generated.json +++ b/service/lambda/generated.json @@ -91,6 +91,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/lambda/sra_operation_order_test.go b/service/lambda/sra_operation_order_test.go new file mode 100644 index 00000000000..d6432466ce5 --- /dev/null +++ b/service/lambda/sra_operation_order_test.go @@ -0,0 +1,2401 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lambda + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddLayerVersionPermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddLayerVersionPermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddPermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddPermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCodeSigningConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCodeSigningConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEventSourceMappingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEventSourceMapping(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFunctionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFunction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFunctionUrlConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFunctionUrlConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCodeSigningConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCodeSigningConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEventSourceMappingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEventSourceMapping(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFunctionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFunction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFunctionCodeSigningConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFunctionCodeSigningConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFunctionConcurrencySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFunctionConcurrency(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFunctionEventInvokeConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFunctionEventInvokeConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFunctionUrlConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFunctionUrlConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLayerVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLayerVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProvisionedConcurrencyConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProvisionedConcurrencyConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccountSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccountSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCodeSigningConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCodeSigningConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEventSourceMappingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEventSourceMapping(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFunctionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFunction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFunctionCodeSigningConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFunctionCodeSigningConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFunctionConcurrencySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFunctionConcurrency(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFunctionConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFunctionConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFunctionEventInvokeConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFunctionEventInvokeConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFunctionRecursionConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFunctionRecursionConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFunctionUrlConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFunctionUrlConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLayerVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLayerVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLayerVersionByArnSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLayerVersionByArn(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLayerVersionPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLayerVersionPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetProvisionedConcurrencyConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetProvisionedConcurrencyConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRuntimeManagementConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRuntimeManagementConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInvokeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Invoke(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInvokeAsyncSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InvokeAsync(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInvokeWithResponseStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InvokeWithResponseStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAliasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAliases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCodeSigningConfigsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCodeSigningConfigs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEventSourceMappingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEventSourceMappings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFunctionEventInvokeConfigsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFunctionEventInvokeConfigs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFunctionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFunctions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFunctionsByCodeSigningConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFunctionsByCodeSigningConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFunctionUrlConfigsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFunctionUrlConfigs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLayersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLayers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLayerVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLayerVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProvisionedConcurrencyConfigsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProvisionedConcurrencyConfigs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVersionsByFunctionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVersionsByFunction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPublishLayerVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PublishLayerVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPublishVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PublishVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutFunctionCodeSigningConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutFunctionCodeSigningConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutFunctionConcurrencySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutFunctionConcurrency(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutFunctionEventInvokeConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutFunctionEventInvokeConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutFunctionRecursionConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutFunctionRecursionConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutProvisionedConcurrencyConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutProvisionedConcurrencyConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRuntimeManagementConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRuntimeManagementConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveLayerVersionPermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveLayerVersionPermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemovePermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemovePermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCodeSigningConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCodeSigningConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEventSourceMappingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEventSourceMapping(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFunctionCodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFunctionCode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFunctionConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFunctionConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFunctionEventInvokeConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFunctionEventInvokeConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFunctionUrlConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFunctionUrlConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/launchwizard/generated.json b/service/launchwizard/generated.json index 482e1d815f9..d6db5b9d2c5 100644 --- a/service/launchwizard/generated.json +++ b/service/launchwizard/generated.json @@ -33,6 +33,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/launchwizard/sra_operation_order_test.go b/service/launchwizard/sra_operation_order_test.go new file mode 100644 index 00000000000..bb3b696fc7a --- /dev/null +++ b/service/launchwizard/sra_operation_order_test.go @@ -0,0 +1,441 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package launchwizard + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWorkloadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWorkload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWorkloadDeploymentPatternSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWorkloadDeploymentPattern(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDeploymentEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDeploymentEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDeploymentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDeployments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkloadDeploymentPatternsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkloadDeploymentPatterns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkloadsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkloads(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/lexmodelbuildingservice/generated.json b/service/lexmodelbuildingservice/generated.json index 878d58c30cc..e5f5ba09a87 100644 --- a/service/lexmodelbuildingservice/generated.json +++ b/service/lexmodelbuildingservice/generated.json @@ -63,6 +63,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/lexmodelbuildingservice/sra_operation_order_test.go b/service/lexmodelbuildingservice/sra_operation_order_test.go new file mode 100644 index 00000000000..795e6ba1573 --- /dev/null +++ b/service/lexmodelbuildingservice/sra_operation_order_test.go @@ -0,0 +1,1491 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lexmodelbuildingservice + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateBotVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBotVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIntentVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIntentVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSlotTypeVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSlotTypeVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBotAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBotAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBotChannelAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBotChannelAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBotVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBotVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIntentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIntent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIntentVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIntentVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSlotTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSlotType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSlotTypeVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSlotTypeVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUtterancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUtterances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBotAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBotAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBotAliasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBotAliases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBotChannelAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBotChannelAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBotChannelAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBotChannelAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBotVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBotVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBuiltinIntentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBuiltinIntent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBuiltinIntentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBuiltinIntents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBuiltinSlotTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBuiltinSlotTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetImportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetImport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIntentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIntent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIntentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIntents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIntentVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIntentVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMigrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMigration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMigrationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMigrations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSlotTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSlotType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSlotTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSlotTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSlotTypeVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSlotTypeVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUtterancesViewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUtterancesView(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBotAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBotAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutIntentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutIntent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutSlotTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutSlotType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartImportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartImport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMigrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMigration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/lexmodelsv2/generated.json b/service/lexmodelsv2/generated.json index 50ed95fd3c4..47f60b57659 100644 --- a/service/lexmodelsv2/generated.json +++ b/service/lexmodelsv2/generated.json @@ -123,6 +123,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/lexmodelsv2/sra_operation_order_test.go b/service/lexmodelsv2/sra_operation_order_test.go new file mode 100644 index 00000000000..b167af801df --- /dev/null +++ b/service/lexmodelsv2/sra_operation_order_test.go @@ -0,0 +1,3591 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lexmodelsv2 + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchCreateCustomVocabularyItemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchCreateCustomVocabularyItem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeleteCustomVocabularyItemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteCustomVocabularyItem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchUpdateCustomVocabularyItemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchUpdateCustomVocabularyItem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBuildBotLocaleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BuildBotLocale(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBotAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBotAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBotLocaleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBotLocale(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBotReplicaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBotReplica(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBotVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBotVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIntentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIntent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateResourcePolicyStatementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateResourcePolicyStatement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSlotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSlot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSlotTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSlotType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTestSetDiscrepancyReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTestSetDiscrepancyReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUploadUrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUploadUrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBotAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBotAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBotLocaleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBotLocale(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBotReplicaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBotReplica(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBotVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBotVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCustomVocabularySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCustomVocabulary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteImportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteImport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIntentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIntent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourcePolicyStatementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourcePolicyStatement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSlotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSlot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSlotTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSlotType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTestSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTestSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUtterancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUtterances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBotAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBotAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBotLocaleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBotLocale(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBotRecommendationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBotRecommendation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBotReplicaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBotReplica(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBotResourceGenerationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBotResourceGeneration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBotVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBotVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCustomVocabularyMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCustomVocabularyMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeImportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeImport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIntentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIntent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSlotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSlot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSlotTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSlotType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTestExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTestExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTestSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTestSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTestSetDiscrepancyReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTestSetDiscrepancyReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTestSetGenerationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTestSetGeneration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGenerateBotElementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GenerateBotElement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTestExecutionArtifactsUrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTestExecutionArtifactsUrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAggregatedUtterancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAggregatedUtterances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBotAliasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBotAliases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBotAliasReplicasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBotAliasReplicas(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBotLocalesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBotLocales(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBotRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBotRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBotReplicasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBotReplicas(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBotResourceGenerationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBotResourceGenerations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBotVersionReplicasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBotVersionReplicas(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBotVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBotVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBuiltInIntentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBuiltInIntents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBuiltInSlotTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBuiltInSlotTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCustomVocabularyItemsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCustomVocabularyItems(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListExportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListExports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListImportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListImports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIntentMetricsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIntentMetrics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIntentPathsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIntentPaths(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIntentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIntents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIntentStageMetricsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIntentStageMetrics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRecommendedIntentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRecommendedIntents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSessionAnalyticsDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSessionAnalyticsData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSessionMetricsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSessionMetrics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSlotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSlots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSlotTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSlotTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTestExecutionResultItemsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTestExecutionResultItems(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTestExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTestExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTestSetRecordsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTestSetRecords(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTestSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTestSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUtteranceAnalyticsDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUtteranceAnalyticsData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUtteranceMetricsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUtteranceMetrics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchAssociatedTranscriptsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchAssociatedTranscripts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartBotRecommendationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartBotRecommendation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartBotResourceGenerationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartBotResourceGeneration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartImportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartImport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartTestExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartTestExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartTestSetGenerationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartTestSetGeneration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopBotRecommendationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopBotRecommendation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBotAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBotAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBotLocaleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBotLocale(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBotRecommendationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBotRecommendation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIntentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIntent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSlotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSlot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSlotTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSlotType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTestSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTestSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/lexruntimeservice/generated.json b/service/lexruntimeservice/generated.json index 01e06e87b73..e79f2f744b3 100644 --- a/service/lexruntimeservice/generated.json +++ b/service/lexruntimeservice/generated.json @@ -26,6 +26,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/lexruntimeservice/sra_operation_order_test.go b/service/lexruntimeservice/sra_operation_order_test.go new file mode 100644 index 00000000000..bc2556b819f --- /dev/null +++ b/service/lexruntimeservice/sra_operation_order_test.go @@ -0,0 +1,196 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lexruntimeservice + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpDeleteSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPostContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PostContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPostTextSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PostText(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/lexruntimev2/generated.json b/service/lexruntimev2/generated.json index 1eb69b3e86d..abd8a3adc2b 100644 --- a/service/lexruntimev2/generated.json +++ b/service/lexruntimev2/generated.json @@ -29,6 +29,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/lexruntimev2/sra_operation_order_test.go b/service/lexruntimev2/sra_operation_order_test.go new file mode 100644 index 00000000000..c37c34efc01 --- /dev/null +++ b/service/lexruntimev2/sra_operation_order_test.go @@ -0,0 +1,231 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lexruntimev2 + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpDeleteSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRecognizeTextSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RecognizeText(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRecognizeUtteranceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RecognizeUtterance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartConversationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartConversation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/licensemanager/generated.json b/service/licensemanager/generated.json index 819cfb487cd..382c1ee3b96 100644 --- a/service/licensemanager/generated.json +++ b/service/licensemanager/generated.json @@ -71,6 +71,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/licensemanager/sra_operation_order_test.go b/service/licensemanager/sra_operation_order_test.go new file mode 100644 index 00000000000..89f999844e6 --- /dev/null +++ b/service/licensemanager/sra_operation_order_test.go @@ -0,0 +1,1771 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package licensemanager + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcceptGrantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptGrant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCheckInLicenseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CheckInLicense(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCheckoutBorrowLicenseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CheckoutBorrowLicense(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCheckoutLicenseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CheckoutLicense(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGrantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGrant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGrantVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGrantVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLicenseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLicense(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLicenseConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLicenseConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLicenseConversionTaskForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLicenseConversionTaskForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLicenseManagerReportGeneratorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLicenseManagerReportGenerator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLicenseVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLicenseVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGrantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGrant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLicenseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLicense(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLicenseConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLicenseConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLicenseManagerReportGeneratorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLicenseManagerReportGenerator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExtendLicenseConsumptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExtendLicenseConsumption(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccessTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccessToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGrantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGrant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLicenseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLicense(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLicenseConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLicenseConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLicenseConversionTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLicenseConversionTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLicenseManagerReportGeneratorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLicenseManagerReportGenerator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLicenseUsageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLicenseUsage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServiceSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssociationsForLicenseConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssociationsForLicenseConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDistributedGrantsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDistributedGrants(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFailuresForLicenseConfigurationOperationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFailuresForLicenseConfigurationOperations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLicenseConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLicenseConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLicenseConversionTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLicenseConversionTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLicenseManagerReportGeneratorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLicenseManagerReportGenerators(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLicensesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLicenses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLicenseSpecificationsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLicenseSpecificationsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLicenseVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLicenseVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReceivedGrantsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReceivedGrants(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReceivedGrantsForOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReceivedGrantsForOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReceivedLicensesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReceivedLicenses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReceivedLicensesForOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReceivedLicensesForOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceInventorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceInventory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTokensSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTokens(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUsageForLicenseConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUsageForLicenseConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRejectGrantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RejectGrant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLicenseConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLicenseConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLicenseManagerReportGeneratorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLicenseManagerReportGenerator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLicenseSpecificationsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLicenseSpecificationsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateServiceSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateServiceSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/licensemanagerlinuxsubscriptions/generated.json b/service/licensemanagerlinuxsubscriptions/generated.json index 188768d735d..af1d703a1b0 100644 --- a/service/licensemanagerlinuxsubscriptions/generated.json +++ b/service/licensemanagerlinuxsubscriptions/generated.json @@ -32,6 +32,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/licensemanagerlinuxsubscriptions/sra_operation_order_test.go b/service/licensemanagerlinuxsubscriptions/sra_operation_order_test.go new file mode 100644 index 00000000000..c0c0bcffa87 --- /dev/null +++ b/service/licensemanagerlinuxsubscriptions/sra_operation_order_test.go @@ -0,0 +1,406 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package licensemanagerlinuxsubscriptions + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpDeregisterSubscriptionProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterSubscriptionProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRegisteredSubscriptionProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRegisteredSubscriptionProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServiceSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLinuxSubscriptionInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLinuxSubscriptionInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLinuxSubscriptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLinuxSubscriptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRegisteredSubscriptionProvidersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRegisteredSubscriptionProviders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterSubscriptionProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterSubscriptionProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateServiceSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateServiceSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/licensemanagerusersubscriptions/generated.json b/service/licensemanagerusersubscriptions/generated.json index 3b5e159e4e9..de6811045b8 100644 --- a/service/licensemanagerusersubscriptions/generated.json +++ b/service/licensemanagerusersubscriptions/generated.json @@ -38,6 +38,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/licensemanagerusersubscriptions/sra_operation_order_test.go b/service/licensemanagerusersubscriptions/sra_operation_order_test.go new file mode 100644 index 00000000000..67b1f2a8601 --- /dev/null +++ b/service/licensemanagerusersubscriptions/sra_operation_order_test.go @@ -0,0 +1,616 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package licensemanagerusersubscriptions + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLicenseServerEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLicenseServerEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLicenseServerEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLicenseServerEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterIdentityProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterIdentityProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIdentityProvidersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIdentityProviders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLicenseServerEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLicenseServerEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProductSubscriptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProductSubscriptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUserAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUserAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterIdentityProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterIdentityProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartProductSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartProductSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopProductSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopProductSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIdentityProviderSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIdentityProviderSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/lightsail/generated.json b/service/lightsail/generated.json index 4d4dfdef3a7..ba6d4d5e6d9 100644 --- a/service/lightsail/generated.json +++ b/service/lightsail/generated.json @@ -182,6 +182,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/lightsail/sra_operation_order_test.go b/service/lightsail/sra_operation_order_test.go new file mode 100644 index 00000000000..f4a68a50c4a --- /dev/null +++ b/service/lightsail/sra_operation_order_test.go @@ -0,0 +1,5656 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lightsail + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAllocateStaticIpSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AllocateStaticIp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachCertificateToDistributionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachCertificateToDistribution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachDiskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachDisk(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachInstancesToLoadBalancerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachInstancesToLoadBalancer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachLoadBalancerTlsCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachLoadBalancerTlsCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachStaticIpSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachStaticIp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCloseInstancePublicPortsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CloseInstancePublicPorts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCopySnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopySnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBucketSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBucket(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBucketAccessKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBucketAccessKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCloudFormationStackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCloudFormationStack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateContactMethodSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateContactMethod(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateContainerServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateContainerService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateContainerServiceDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateContainerServiceDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateContainerServiceRegistryLoginSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateContainerServiceRegistryLogin(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDiskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDisk(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDiskFromSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDiskFromSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDiskSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDiskSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDistributionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDistribution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDomainEntrySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDomainEntry(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGUISessionAccessDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGUISessionAccessDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInstancesFromSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInstancesFromSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInstanceSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInstanceSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateKeyPairSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateKeyPair(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLoadBalancerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLoadBalancer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLoadBalancerTlsCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLoadBalancerTlsCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRelationalDatabaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRelationalDatabase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRelationalDatabaseFromSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRelationalDatabaseFromSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRelationalDatabaseSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRelationalDatabaseSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAlarmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAlarm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAutoSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAutoSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBucketSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBucket(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBucketAccessKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBucketAccessKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteContactMethodSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteContactMethod(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteContainerImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteContainerImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteContainerServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteContainerService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDiskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDisk(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDiskSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDiskSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDistributionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDistribution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDomainEntrySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDomainEntry(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInstanceSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInstanceSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteKeyPairSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteKeyPair(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteKnownHostKeysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteKnownHostKeys(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLoadBalancerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLoadBalancer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLoadBalancerTlsCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLoadBalancerTlsCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRelationalDatabaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRelationalDatabase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRelationalDatabaseSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRelationalDatabaseSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachCertificateFromDistributionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachCertificateFromDistribution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachDiskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachDisk(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachInstancesFromLoadBalancerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachInstancesFromLoadBalancer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachStaticIpSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachStaticIp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableAddOnSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableAddOn(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDownloadDefaultKeyPairSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DownloadDefaultKeyPair(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableAddOnSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableAddOn(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetActiveNamesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetActiveNames(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAlarmsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAlarms(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAutoSnapshotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAutoSnapshots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBlueprintsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBlueprints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketAccessKeysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketAccessKeys(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketBundlesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketBundles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketMetricDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketMetricData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBuckets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBundlesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBundles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCertificatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCertificates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCloudFormationStackRecordsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCloudFormationStackRecords(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetContactMethodsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetContactMethods(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetContainerAPIMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetContainerAPIMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetContainerImagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetContainerImages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetContainerLogSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetContainerLog(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetContainerServiceDeploymentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetContainerServiceDeployments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetContainerServiceMetricDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetContainerServiceMetricData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetContainerServicePowersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetContainerServicePowers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetContainerServicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetContainerServices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCostEstimateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCostEstimate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDiskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDisk(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDisksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDisks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDiskSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDiskSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDiskSnapshotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDiskSnapshots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDistributionBundlesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDistributionBundles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDistributionLatestCacheResetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDistributionLatestCacheReset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDistributionMetricDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDistributionMetricData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDistributionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDistributions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDomainsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDomains(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetExportSnapshotRecordsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetExportSnapshotRecords(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInstanceAccessDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInstanceAccessDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInstanceMetricDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInstanceMetricData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInstancePortStatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInstancePortStates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInstanceSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInstanceSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInstanceSnapshotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInstanceSnapshots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInstanceStateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInstanceState(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetKeyPairSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetKeyPair(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetKeyPairsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetKeyPairs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLoadBalancerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLoadBalancer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLoadBalancerMetricDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLoadBalancerMetricData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLoadBalancersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLoadBalancers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLoadBalancerTlsCertificatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLoadBalancerTlsCertificates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLoadBalancerTlsPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLoadBalancerTlsPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOperationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOperations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOperationsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOperationsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRegionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRegions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRelationalDatabaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRelationalDatabase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRelationalDatabaseBlueprintsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRelationalDatabaseBlueprints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRelationalDatabaseBundlesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRelationalDatabaseBundles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRelationalDatabaseEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRelationalDatabaseEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRelationalDatabaseLogEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRelationalDatabaseLogEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRelationalDatabaseLogStreamsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRelationalDatabaseLogStreams(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRelationalDatabaseMasterUserPasswordSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRelationalDatabaseMasterUserPassword(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRelationalDatabaseMetricDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRelationalDatabaseMetricData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRelationalDatabaseParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRelationalDatabaseParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRelationalDatabasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRelationalDatabases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRelationalDatabaseSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRelationalDatabaseSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRelationalDatabaseSnapshotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRelationalDatabaseSnapshots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSetupHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSetupHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStaticIpSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStaticIp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStaticIpsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStaticIps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportKeyPairSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportKeyPair(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpIsVpcPeeredSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.IsVpcPeered(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpOpenInstancePublicPortsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.OpenInstancePublicPorts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPeerVpcSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PeerVpc(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAlarmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAlarm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutInstancePublicPortsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutInstancePublicPorts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRebootInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RebootInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRebootRelationalDatabaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RebootRelationalDatabase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterContainerImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterContainerImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReleaseStaticIpSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReleaseStaticIp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetDistributionCacheSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetDistributionCache(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendContactMethodVerificationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendContactMethodVerification(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetIpAddressTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetIpAddressType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetResourceAccessForBucketSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetResourceAccessForBucket(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetupInstanceHttpsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetupInstanceHttps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartGUISessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartGUISession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartRelationalDatabaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartRelationalDatabase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopGUISessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopGUISession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopRelationalDatabaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopRelationalDatabase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestAlarmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestAlarm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUnpeerVpcSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UnpeerVpc(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBucketSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBucket(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBucketBundleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBucketBundle(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateContainerServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateContainerService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDistributionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDistribution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDistributionBundleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDistributionBundle(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDomainEntrySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDomainEntry(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateInstanceMetadataOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateInstanceMetadataOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLoadBalancerAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLoadBalancerAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRelationalDatabaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRelationalDatabase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRelationalDatabaseParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRelationalDatabaseParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/location/generated.json b/service/location/generated.json index be550fb9c22..94a1ed7906a 100644 --- a/service/location/generated.json +++ b/service/location/generated.json @@ -81,6 +81,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/location/sra_operation_order_test.go b/service/location/sra_operation_order_test.go new file mode 100644 index 00000000000..f852a1e155a --- /dev/null +++ b/service/location/sra_operation_order_test.go @@ -0,0 +1,2121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package location + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateTrackerConsumerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateTrackerConsumer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeleteDevicePositionHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteDevicePositionHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeleteGeofenceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteGeofence(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchEvaluateGeofencesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchEvaluateGeofences(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetDevicePositionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetDevicePosition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchPutGeofenceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchPutGeofence(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchUpdateDevicePositionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchUpdateDevicePosition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCalculateRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CalculateRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCalculateRouteMatrixSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CalculateRouteMatrix(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGeofenceCollectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGeofenceCollection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMapSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMap(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePlaceIndexSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePlaceIndex(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRouteCalculatorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRouteCalculator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTrackerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTracker(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGeofenceCollectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGeofenceCollection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMapSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMap(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePlaceIndexSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePlaceIndex(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRouteCalculatorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRouteCalculator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTrackerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTracker(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGeofenceCollectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGeofenceCollection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMapSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMap(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePlaceIndexSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePlaceIndex(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRouteCalculatorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRouteCalculator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTrackerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTracker(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateTrackerConsumerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateTrackerConsumer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpForecastGeofenceEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ForecastGeofenceEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDevicePositionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDevicePosition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDevicePositionHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDevicePositionHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGeofenceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGeofence(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMapGlyphsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMapGlyphs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMapSpritesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMapSprites(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMapStyleDescriptorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMapStyleDescriptor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMapTileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMapTile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPlaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPlace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDevicePositionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDevicePositions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGeofenceCollectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGeofenceCollections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGeofencesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGeofences(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListKeysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListKeys(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMapsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMaps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPlaceIndexesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPlaceIndexes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRouteCalculatorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRouteCalculators(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTrackerConsumersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTrackerConsumers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTrackersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTrackers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutGeofenceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutGeofence(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchPlaceIndexForPositionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchPlaceIndexForPosition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchPlaceIndexForSuggestionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchPlaceIndexForSuggestions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchPlaceIndexForTextSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchPlaceIndexForText(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGeofenceCollectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGeofenceCollection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMapSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMap(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePlaceIndexSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePlaceIndex(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRouteCalculatorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRouteCalculator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTrackerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTracker(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpVerifyDevicePositionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.VerifyDevicePosition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/lookoutequipment/generated.json b/service/lookoutequipment/generated.json index 2c3fcb34a57..0a55861304d 100644 --- a/service/lookoutequipment/generated.json +++ b/service/lookoutequipment/generated.json @@ -70,6 +70,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/lookoutequipment/sra_operation_order_test.go b/service/lookoutequipment/sra_operation_order_test.go new file mode 100644 index 00000000000..276a7e5dcc3 --- /dev/null +++ b/service/lookoutequipment/sra_operation_order_test.go @@ -0,0 +1,1736 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lookoutequipment + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInferenceSchedulerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInferenceScheduler(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLabelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLabel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLabelGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLabelGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRetrainingSchedulerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRetrainingScheduler(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInferenceSchedulerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInferenceScheduler(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLabelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLabel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLabelGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLabelGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRetrainingSchedulerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRetrainingScheduler(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDataIngestionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDataIngestionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInferenceSchedulerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInferenceScheduler(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLabelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLabel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLabelGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLabelGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeModelVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeModelVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRetrainingSchedulerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRetrainingScheduler(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportModelVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportModelVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataIngestionJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataIngestionJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDatasetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDatasets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInferenceEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInferenceEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInferenceExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInferenceExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInferenceSchedulersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInferenceSchedulers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLabelGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLabelGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLabelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLabels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListModelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListModels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListModelVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListModelVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRetrainingSchedulersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRetrainingSchedulers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSensorStatisticsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSensorStatistics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDataIngestionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDataIngestionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartInferenceSchedulerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartInferenceScheduler(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartRetrainingSchedulerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartRetrainingScheduler(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopInferenceSchedulerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopInferenceScheduler(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopRetrainingSchedulerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopRetrainingScheduler(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateActiveModelVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateActiveModelVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateInferenceSchedulerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateInferenceScheduler(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLabelGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLabelGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRetrainingSchedulerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRetrainingScheduler(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/lookoutmetrics/generated.json b/service/lookoutmetrics/generated.json index 5b22478ca9a..1a7890a4937 100644 --- a/service/lookoutmetrics/generated.json +++ b/service/lookoutmetrics/generated.json @@ -51,6 +51,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/lookoutmetrics/sra_operation_order_test.go b/service/lookoutmetrics/sra_operation_order_test.go new file mode 100644 index 00000000000..aa0cedf0d78 --- /dev/null +++ b/service/lookoutmetrics/sra_operation_order_test.go @@ -0,0 +1,1071 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lookoutmetrics + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpActivateAnomalyDetectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ActivateAnomalyDetector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBackTestAnomalyDetectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BackTestAnomalyDetector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAlertSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAlert(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAnomalyDetectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAnomalyDetector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMetricSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMetricSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeactivateAnomalyDetectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeactivateAnomalyDetector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAlertSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAlert(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAnomalyDetectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAnomalyDetector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAlertSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAlert(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAnomalyDetectionExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAnomalyDetectionExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAnomalyDetectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAnomalyDetector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMetricSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMetricSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetectMetricSetConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetectMetricSetConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAnomalyGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAnomalyGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataQualityMetricsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataQualityMetrics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFeedbackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFeedback(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSampleDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSampleData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAlertsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAlerts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAnomalyDetectorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAnomalyDetectors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAnomalyGroupRelatedMetricsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAnomalyGroupRelatedMetrics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAnomalyGroupSummariesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAnomalyGroupSummaries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAnomalyGroupTimeSeriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAnomalyGroupTimeSeries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMetricSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMetricSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutFeedbackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutFeedback(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAlertSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAlert(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAnomalyDetectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAnomalyDetector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMetricSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMetricSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/lookoutvision/generated.json b/service/lookoutvision/generated.json index ff7ebcbf679..88b62e494f3 100644 --- a/service/lookoutvision/generated.json +++ b/service/lookoutvision/generated.json @@ -43,6 +43,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/lookoutvision/sra_operation_order_test.go b/service/lookoutvision/sra_operation_order_test.go new file mode 100644 index 00000000000..8322a9926da --- /dev/null +++ b/service/lookoutvision/sra_operation_order_test.go @@ -0,0 +1,791 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package lookoutvision + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeModelPackagingJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeModelPackagingJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetectAnomaliesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetectAnomalies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDatasetEntriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDatasetEntries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListModelPackagingJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListModelPackagingJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListModelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListModels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProjectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProjects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartModelPackagingJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartModelPackagingJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDatasetEntriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDatasetEntries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/m2/generated.json b/service/m2/generated.json index 654b8f393be..d636f36080e 100644 --- a/service/m2/generated.json +++ b/service/m2/generated.json @@ -55,6 +55,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/m2/sra_operation_order_test.go b/service/m2/sra_operation_order_test.go new file mode 100644 index 00000000000..43bdb848fa9 --- /dev/null +++ b/service/m2/sra_operation_order_test.go @@ -0,0 +1,1211 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package m2 + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCancelBatchJobExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelBatchJobExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataSetImportTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataSetImportTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationFromEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplicationFromEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApplicationVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApplicationVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBatchJobExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBatchJobExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataSetDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataSetDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataSetImportTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataSetImportTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSignedBluinsightsUrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSignedBluinsightsUrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplicationVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBatchJobDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBatchJobDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBatchJobExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBatchJobExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBatchJobRestartPointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBatchJobRestartPoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataSetImportHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataSetImportHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDeploymentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDeployments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEngineVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEngineVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEnvironmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEnvironments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartBatchJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartBatchJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/machinelearning/generated.json b/service/machinelearning/generated.json index 61eff890cac..60b88b24729 100644 --- a/service/machinelearning/generated.json +++ b/service/machinelearning/generated.json @@ -49,6 +49,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/machinelearning/sra_operation_order_test.go b/service/machinelearning/sra_operation_order_test.go new file mode 100644 index 00000000000..f91e113566b --- /dev/null +++ b/service/machinelearning/sra_operation_order_test.go @@ -0,0 +1,1001 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package machinelearning + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBatchPredictionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBatchPrediction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataSourceFromRDSSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataSourceFromRDS(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataSourceFromRedshiftSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataSourceFromRedshift(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataSourceFromS3SRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataSourceFromS3(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEvaluationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEvaluation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMLModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMLModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRealtimeEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRealtimeEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBatchPredictionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBatchPrediction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEvaluationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEvaluation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMLModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMLModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRealtimeEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRealtimeEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBatchPredictionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBatchPredictions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDataSourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDataSources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEvaluationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEvaluations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMLModelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMLModels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBatchPredictionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBatchPrediction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEvaluationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEvaluation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMLModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMLModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPredictSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Predict(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBatchPredictionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBatchPrediction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEvaluationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEvaluation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMLModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMLModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/macie2/generated.json b/service/macie2/generated.json index e3bf46395c4..89fef071fa8 100644 --- a/service/macie2/generated.json +++ b/service/macie2/generated.json @@ -102,6 +102,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/macie2/sra_operation_order_test.go b/service/macie2/sra_operation_order_test.go new file mode 100644 index 00000000000..f9cbd7d1049 --- /dev/null +++ b/service/macie2/sra_operation_order_test.go @@ -0,0 +1,2856 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package macie2 + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcceptInvitationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptInvitation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetCustomDataIdentifiersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetCustomDataIdentifiers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchUpdateAutomatedDiscoveryAccountsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchUpdateAutomatedDiscoveryAccounts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAllowListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAllowList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateClassificationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateClassificationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCustomDataIdentifierSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCustomDataIdentifier(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFindingsFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFindingsFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInvitationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInvitations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMemberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMember(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSampleFindingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSampleFindings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeclineInvitationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeclineInvitations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAllowListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAllowList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCustomDataIdentifierSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCustomDataIdentifier(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFindingsFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFindingsFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInvitationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInvitations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMemberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMember(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBucketsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBuckets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClassificationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeClassificationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOrganizationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOrganizationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableMacieSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableMacie(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableOrganizationAdminAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableOrganizationAdminAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateFromAdministratorAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateFromAdministratorAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateFromMasterAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateFromMasterAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateMemberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateMember(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableMacieSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableMacie(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableOrganizationAdminAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableOrganizationAdminAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAdministratorAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAdministratorAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAllowListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAllowList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAutomatedDiscoveryConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAutomatedDiscoveryConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketStatisticsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketStatistics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetClassificationExportConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetClassificationExportConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetClassificationScopeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetClassificationScope(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCustomDataIdentifierSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCustomDataIdentifier(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFindingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFindings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFindingsFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFindingsFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFindingsPublicationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFindingsPublicationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFindingStatisticsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFindingStatistics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInvitationsCountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInvitationsCount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMacieSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMacieSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMasterAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMasterAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMemberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMember(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRevealConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRevealConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSensitiveDataOccurrencesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSensitiveDataOccurrences(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSensitiveDataOccurrencesAvailabilitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSensitiveDataOccurrencesAvailability(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSensitivityInspectionTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSensitivityInspectionTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUsageStatisticsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUsageStatistics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUsageTotalsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUsageTotals(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAllowListsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAllowLists(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAutomatedDiscoveryAccountsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAutomatedDiscoveryAccounts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListClassificationJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListClassificationJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListClassificationScopesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListClassificationScopes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCustomDataIdentifiersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCustomDataIdentifiers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFindingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFindings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFindingsFiltersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFindingsFilters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInvitationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInvitations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListManagedDataIdentifiersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListManagedDataIdentifiers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOrganizationAdminAccountsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOrganizationAdminAccounts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceProfileArtifactsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceProfileArtifacts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceProfileDetectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceProfileDetections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSensitivityInspectionTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSensitivityInspectionTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutClassificationExportConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutClassificationExportConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutFindingsPublicationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutFindingsPublicationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestCustomDataIdentifierSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestCustomDataIdentifier(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAllowListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAllowList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAutomatedDiscoveryConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAutomatedDiscoveryConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateClassificationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateClassificationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateClassificationScopeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateClassificationScope(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFindingsFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFindingsFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMacieSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMacieSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMemberSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMemberSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateOrganizationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateOrganizationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateResourceProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateResourceProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateResourceProfileDetectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateResourceProfileDetections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRevealConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRevealConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSensitivityInspectionTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSensitivityInspectionTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/mailmanager/generated.json b/service/mailmanager/generated.json index aae27e17256..eb06b3a15f2 100644 --- a/service/mailmanager/generated.json +++ b/service/mailmanager/generated.json @@ -81,6 +81,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/mailmanager/sra_operation_order_test.go b/service/mailmanager/sra_operation_order_test.go new file mode 100644 index 00000000000..91e29cbbbe7 --- /dev/null +++ b/service/mailmanager/sra_operation_order_test.go @@ -0,0 +1,2121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package mailmanager + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateAddonInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAddonInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAddonSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAddonSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAddressListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAddressList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAddressListImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAddressListImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateArchiveSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateArchive(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIngressPointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIngressPoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRelaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRelay(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRuleSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRuleSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTrafficPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTrafficPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAddonInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAddonInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAddonSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAddonSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAddressListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAddressList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteArchiveSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteArchive(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIngressPointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIngressPoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRelaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRelay(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRuleSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRuleSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTrafficPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTrafficPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterMemberFromAddressListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterMemberFromAddressList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAddonInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAddonInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAddonSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAddonSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAddressListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAddressList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAddressListImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAddressListImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetArchiveSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetArchive(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetArchiveExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetArchiveExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetArchiveMessageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetArchiveMessage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetArchiveMessageContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetArchiveMessageContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetArchiveSearchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetArchiveSearch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetArchiveSearchResultsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetArchiveSearchResults(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIngressPointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIngressPoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMemberOfAddressListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMemberOfAddressList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRelaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRelay(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRuleSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRuleSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTrafficPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTrafficPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAddonInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAddonInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAddonSubscriptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAddonSubscriptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAddressListImportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAddressListImportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAddressListsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAddressLists(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListArchiveExportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListArchiveExports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListArchivesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListArchives(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListArchiveSearchesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListArchiveSearches(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIngressPointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIngressPoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMembersOfAddressListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMembersOfAddressList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRelaysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRelays(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRuleSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRuleSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTrafficPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTrafficPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterMemberToAddressListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterMemberToAddressList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartAddressListImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartAddressListImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartArchiveExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartArchiveExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartArchiveSearchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartArchiveSearch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopAddressListImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopAddressListImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopArchiveExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopArchiveExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopArchiveSearchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopArchiveSearch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateArchiveSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateArchive(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIngressPointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIngressPoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRelaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRelay(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRuleSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRuleSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTrafficPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTrafficPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/managedblockchain/generated.json b/service/managedblockchain/generated.json index faa1b1406cb..37cd78b5dd7 100644 --- a/service/managedblockchain/generated.json +++ b/service/managedblockchain/generated.json @@ -48,6 +48,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/managedblockchain/sra_operation_order_test.go b/service/managedblockchain/sra_operation_order_test.go new file mode 100644 index 00000000000..a10175176a0 --- /dev/null +++ b/service/managedblockchain/sra_operation_order_test.go @@ -0,0 +1,966 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package managedblockchain + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateAccessorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAccessor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMemberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMember(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateNetworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNetwork(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateNodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProposalSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProposal(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccessorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccessor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMemberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMember(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccessorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccessor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMemberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMember(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetNetworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetNetwork(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetNodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetNode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetProposalSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetProposal(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccessorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccessors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInvitationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInvitations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNetworksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNetworks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNodesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNodes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProposalsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProposals(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProposalVotesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProposalVotes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRejectInvitationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RejectInvitation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMemberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMember(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateNodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateNode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpVoteOnProposalSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.VoteOnProposal(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/managedblockchainquery/generated.json b/service/managedblockchainquery/generated.json index 93c1b8bcf28..dedd025b1b2 100644 --- a/service/managedblockchainquery/generated.json +++ b/service/managedblockchainquery/generated.json @@ -30,6 +30,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/managedblockchainquery/sra_operation_order_test.go b/service/managedblockchainquery/sra_operation_order_test.go new file mode 100644 index 00000000000..1dfa852df27 --- /dev/null +++ b/service/managedblockchainquery/sra_operation_order_test.go @@ -0,0 +1,336 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package managedblockchainquery + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchGetTokenBalanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetTokenBalance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAssetContractSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAssetContract(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTokenBalanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTokenBalance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTransactionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTransaction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssetContractsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssetContracts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFilteredTransactionEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFilteredTransactionEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTokenBalancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTokenBalances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTransactionEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTransactionEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTransactionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTransactions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/marketplaceagreement/generated.json b/service/marketplaceagreement/generated.json index 2170cbd0ed9..a4fc827b8ca 100644 --- a/service/marketplaceagreement/generated.json +++ b/service/marketplaceagreement/generated.json @@ -24,6 +24,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/marketplaceagreement/sra_operation_order_test.go b/service/marketplaceagreement/sra_operation_order_test.go new file mode 100644 index 00000000000..4f080441e0c --- /dev/null +++ b/service/marketplaceagreement/sra_operation_order_test.go @@ -0,0 +1,126 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package marketplaceagreement + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpDescribeAgreementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAgreement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAgreementTermsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAgreementTerms(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchAgreementsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchAgreements(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/marketplacecatalog/generated.json b/service/marketplacecatalog/generated.json index 202ca0ad1eb..014dc3d67fa 100644 --- a/service/marketplacecatalog/generated.json +++ b/service/marketplacecatalog/generated.json @@ -38,6 +38,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/marketplacecatalog/sra_operation_order_test.go b/service/marketplacecatalog/sra_operation_order_test.go new file mode 100644 index 00000000000..99c5f198116 --- /dev/null +++ b/service/marketplacecatalog/sra_operation_order_test.go @@ -0,0 +1,476 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package marketplacecatalog + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchDescribeEntitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDescribeEntities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelChangeSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelChangeSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeChangeSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeChangeSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEntitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEntity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListChangeSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListChangeSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEntitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEntities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartChangeSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartChangeSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/marketplacecommerceanalytics/generated.json b/service/marketplacecommerceanalytics/generated.json index 7051b26f145..0182d523f15 100644 --- a/service/marketplacecommerceanalytics/generated.json +++ b/service/marketplacecommerceanalytics/generated.json @@ -23,6 +23,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/marketplacecommerceanalytics/sra_operation_order_test.go b/service/marketplacecommerceanalytics/sra_operation_order_test.go new file mode 100644 index 00000000000..6d0838cb03f --- /dev/null +++ b/service/marketplacecommerceanalytics/sra_operation_order_test.go @@ -0,0 +1,91 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package marketplacecommerceanalytics + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpGenerateDataSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GenerateDataSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartSupportDataExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartSupportDataExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/marketplacedeployment/generated.json b/service/marketplacedeployment/generated.json index bee16809748..969144aa2ff 100644 --- a/service/marketplacedeployment/generated.json +++ b/service/marketplacedeployment/generated.json @@ -25,6 +25,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/errors.go", "types/types.go", "validators.go" diff --git a/service/marketplacedeployment/sra_operation_order_test.go b/service/marketplacedeployment/sra_operation_order_test.go new file mode 100644 index 00000000000..0d480ea224f --- /dev/null +++ b/service/marketplacedeployment/sra_operation_order_test.go @@ -0,0 +1,161 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package marketplacedeployment + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutDeploymentParameterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutDeploymentParameter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/marketplaceentitlementservice/generated.json b/service/marketplaceentitlementservice/generated.json index 205935bcd58..534c0808894 100644 --- a/service/marketplaceentitlementservice/generated.json +++ b/service/marketplaceentitlementservice/generated.json @@ -22,6 +22,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/marketplaceentitlementservice/sra_operation_order_test.go b/service/marketplaceentitlementservice/sra_operation_order_test.go new file mode 100644 index 00000000000..497aec3067a --- /dev/null +++ b/service/marketplaceentitlementservice/sra_operation_order_test.go @@ -0,0 +1,56 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package marketplaceentitlementservice + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpGetEntitlementsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEntitlements(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/marketplacemetering/generated.json b/service/marketplacemetering/generated.json index 4f3c56e6fce..505b9e171bd 100644 --- a/service/marketplacemetering/generated.json +++ b/service/marketplacemetering/generated.json @@ -25,6 +25,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/marketplacemetering/sra_operation_order_test.go b/service/marketplacemetering/sra_operation_order_test.go new file mode 100644 index 00000000000..def0b79b966 --- /dev/null +++ b/service/marketplacemetering/sra_operation_order_test.go @@ -0,0 +1,161 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package marketplacemetering + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchMeterUsageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchMeterUsage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMeterUsageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MeterUsage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterUsageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterUsage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResolveCustomerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResolveCustomer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/marketplacereporting/generated.json b/service/marketplacereporting/generated.json index 6361cb609f0..6dd498d5a1b 100644 --- a/service/marketplacereporting/generated.json +++ b/service/marketplacereporting/generated.json @@ -22,6 +22,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/errors.go", "types/types.go", "validators.go" diff --git a/service/marketplacereporting/sra_operation_order_test.go b/service/marketplacereporting/sra_operation_order_test.go new file mode 100644 index 00000000000..949d35bb9ff --- /dev/null +++ b/service/marketplacereporting/sra_operation_order_test.go @@ -0,0 +1,56 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package marketplacereporting + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpGetBuyerDashboardSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBuyerDashboard(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/mediaconnect/generated.json b/service/mediaconnect/generated.json index 74a34303b39..5acc5a6f0f5 100644 --- a/service/mediaconnect/generated.json +++ b/service/mediaconnect/generated.json @@ -73,6 +73,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/mediaconnect/sra_operation_order_test.go b/service/mediaconnect/sra_operation_order_test.go new file mode 100644 index 00000000000..ac6ccdab1e4 --- /dev/null +++ b/service/mediaconnect/sra_operation_order_test.go @@ -0,0 +1,1841 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package mediaconnect + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddBridgeOutputsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddBridgeOutputs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddBridgeSourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddBridgeSources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddFlowMediaStreamsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddFlowMediaStreams(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddFlowOutputsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddFlowOutputs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddFlowSourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddFlowSources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddFlowVpcInterfacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddFlowVpcInterfaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBridgeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBridge(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBridgeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBridge(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterGatewayInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterGatewayInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBridgeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBridge(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFlowSourceMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFlowSourceMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFlowSourceThumbnailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFlowSourceThumbnail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGatewayInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGatewayInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOfferingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOffering(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReservationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReservation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGrantFlowEntitlementsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GrantFlowEntitlements(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBridgesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBridges(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEntitlementsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEntitlements(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFlowsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFlows(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGatewayInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGatewayInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGatewaysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGateways(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOfferingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOfferings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReservationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReservations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPurchaseOfferingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PurchaseOffering(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveBridgeOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveBridgeOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveBridgeSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveBridgeSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveFlowMediaStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveFlowMediaStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveFlowOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveFlowOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveFlowSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveFlowSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveFlowVpcInterfaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveFlowVpcInterface(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRevokeFlowEntitlementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RevokeFlowEntitlement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBridgeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBridge(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBridgeOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBridgeOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBridgeSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBridgeSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBridgeStateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBridgeState(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFlowEntitlementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFlowEntitlement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFlowMediaStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFlowMediaStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFlowOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFlowOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFlowSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFlowSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGatewayInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGatewayInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/mediaconvert/generated.json b/service/mediaconvert/generated.json index 67f9f1322a3..5d02c9b9b0a 100644 --- a/service/mediaconvert/generated.json +++ b/service/mediaconvert/generated.json @@ -52,6 +52,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/mediaconvert/sra_operation_order_test.go b/service/mediaconvert/sra_operation_order_test.go new file mode 100644 index 00000000000..a4f8ef229bd --- /dev/null +++ b/service/mediaconvert/sra_operation_order_test.go @@ -0,0 +1,1106 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package mediaconvert + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateJobTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateJobTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePresetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePreset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteJobTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteJobTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePresetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePreset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetJobTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetJobTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPresetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPreset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJobTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJobTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPresetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPresets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListQueuesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListQueues(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpProbeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Probe(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateJobTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateJobTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePresetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePreset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/medialive/generated.json b/service/medialive/generated.json index 5e9886f666f..dcd7834dab7 100644 --- a/service/medialive/generated.json +++ b/service/medialive/generated.json @@ -136,6 +136,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/medialive/sra_operation_order_test.go b/service/medialive/sra_operation_order_test.go new file mode 100644 index 00000000000..9e7a25ca171 --- /dev/null +++ b/service/medialive/sra_operation_order_test.go @@ -0,0 +1,4046 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package medialive + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcceptInputDeviceTransferSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptInputDeviceTransfer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeleteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDelete(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchStartSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchStart(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchStopSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchStop(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchUpdateScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchUpdateSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelInputDeviceTransferSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelInputDeviceTransfer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpClaimDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ClaimDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateChannelPlacementGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateChannelPlacementGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCloudWatchAlarmTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCloudWatchAlarmTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCloudWatchAlarmTemplateGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCloudWatchAlarmTemplateGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEventBridgeRuleTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEventBridgeRuleTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEventBridgeRuleTemplateGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEventBridgeRuleTemplateGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInputSecurityGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInputSecurityGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMultiplexSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMultiplex(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMultiplexProgramSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMultiplexProgram(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateNetworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNetwork(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateNodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateNodeRegistrationScriptSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNodeRegistrationScript(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePartnerInputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePartnerInput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSignalMapSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSignalMap(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteChannelPlacementGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteChannelPlacementGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCloudWatchAlarmTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCloudWatchAlarmTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCloudWatchAlarmTemplateGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCloudWatchAlarmTemplateGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEventBridgeRuleTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEventBridgeRuleTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEventBridgeRuleTemplateGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEventBridgeRuleTemplateGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInputSecurityGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInputSecurityGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMultiplexSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMultiplex(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMultiplexProgramSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMultiplexProgram(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNetworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNetwork(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteReservationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteReservation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSignalMapSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSignalMap(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccountConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccountConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeChannelPlacementGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeChannelPlacementGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInputDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInputDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInputDeviceThumbnailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInputDeviceThumbnail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInputSecurityGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInputSecurityGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMultiplexSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMultiplex(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMultiplexProgramSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMultiplexProgram(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeNetworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeNetwork(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeNodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeNode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOfferingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOffering(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReservationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReservation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeThumbnailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeThumbnails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCloudWatchAlarmTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCloudWatchAlarmTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCloudWatchAlarmTemplateGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCloudWatchAlarmTemplateGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEventBridgeRuleTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEventBridgeRuleTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEventBridgeRuleTemplateGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEventBridgeRuleTemplateGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSignalMapSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSignalMap(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListChannelPlacementGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListChannelPlacementGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListChannelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListChannels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCloudWatchAlarmTemplateGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCloudWatchAlarmTemplateGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCloudWatchAlarmTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCloudWatchAlarmTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEventBridgeRuleTemplateGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEventBridgeRuleTemplateGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEventBridgeRuleTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEventBridgeRuleTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInputDevicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInputDevices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInputDeviceTransfersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInputDeviceTransfers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInputsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInputs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInputSecurityGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInputSecurityGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMultiplexesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMultiplexes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMultiplexProgramsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMultiplexPrograms(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNetworksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNetworks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNodesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNodes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOfferingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOfferings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReservationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReservations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSignalMapsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSignalMaps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPurchaseOfferingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PurchaseOffering(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRebootInputDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RebootInputDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRejectInputDeviceTransferSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RejectInputDeviceTransfer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestartChannelPipelinesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestartChannelPipelines(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDeleteMonitorDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDeleteMonitorDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartInputDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartInputDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartInputDeviceMaintenanceWindowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartInputDeviceMaintenanceWindow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMonitorDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMonitorDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMultiplexSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMultiplex(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartUpdateSignalMapSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartUpdateSignalMap(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopInputDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopInputDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopMultiplexSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopMultiplex(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTransferInputDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TransferInputDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAccountConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAccountConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateChannelClassSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateChannelClass(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateChannelPlacementGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateChannelPlacementGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCloudWatchAlarmTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCloudWatchAlarmTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCloudWatchAlarmTemplateGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCloudWatchAlarmTemplateGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEventBridgeRuleTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEventBridgeRuleTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEventBridgeRuleTemplateGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEventBridgeRuleTemplateGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateInputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateInput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateInputDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateInputDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateInputSecurityGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateInputSecurityGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMultiplexSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMultiplex(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMultiplexProgramSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMultiplexProgram(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateNetworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateNetwork(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateNodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateNode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateNodeStateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateNodeState(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateReservationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateReservation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/mediapackage/generated.json b/service/mediapackage/generated.json index 0ad99961978..79f7c504f27 100644 --- a/service/mediapackage/generated.json +++ b/service/mediapackage/generated.json @@ -40,6 +40,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/mediapackage/sra_operation_order_test.go b/service/mediapackage/sra_operation_order_test.go new file mode 100644 index 00000000000..e00ea193683 --- /dev/null +++ b/service/mediapackage/sra_operation_order_test.go @@ -0,0 +1,686 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package mediapackage + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpConfigureLogsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ConfigureLogs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateHarvestJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateHarvestJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateOriginEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateOriginEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteOriginEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteOriginEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeHarvestJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeHarvestJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOriginEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOriginEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListChannelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListChannels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListHarvestJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListHarvestJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOriginEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOriginEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRotateChannelCredentialsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RotateChannelCredentials(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRotateIngestEndpointCredentialsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RotateIngestEndpointCredentials(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateOriginEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateOriginEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/mediapackagev2/generated.json b/service/mediapackagev2/generated.json index 415656aaab4..123fee01df2 100644 --- a/service/mediapackagev2/generated.json +++ b/service/mediapackagev2/generated.json @@ -49,6 +49,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/mediapackagev2/sra_operation_order_test.go b/service/mediapackagev2/sra_operation_order_test.go new file mode 100644 index 00000000000..f2dd0840317 --- /dev/null +++ b/service/mediapackagev2/sra_operation_order_test.go @@ -0,0 +1,1001 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package mediapackagev2 + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCancelHarvestJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelHarvestJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateChannelGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateChannelGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateHarvestJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateHarvestJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateOriginEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateOriginEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteChannelGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteChannelGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteChannelPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteChannelPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteOriginEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteOriginEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteOriginEndpointPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteOriginEndpointPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetChannelGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetChannelGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetChannelPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetChannelPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetHarvestJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetHarvestJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOriginEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOriginEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOriginEndpointPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOriginEndpointPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListChannelGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListChannelGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListChannelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListChannels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListHarvestJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListHarvestJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOriginEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOriginEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutChannelPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutChannelPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutOriginEndpointPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutOriginEndpointPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateChannelGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateChannelGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateOriginEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateOriginEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/mediapackagevod/generated.json b/service/mediapackagevod/generated.json index ad836984089..34b12716c9a 100644 --- a/service/mediapackagevod/generated.json +++ b/service/mediapackagevod/generated.json @@ -38,6 +38,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/mediapackagevod/sra_operation_order_test.go b/service/mediapackagevod/sra_operation_order_test.go new file mode 100644 index 00000000000..5c4607ef97d --- /dev/null +++ b/service/mediapackagevod/sra_operation_order_test.go @@ -0,0 +1,616 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package mediapackagevod + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpConfigureLogsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ConfigureLogs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAssetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAsset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePackagingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePackagingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePackagingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePackagingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAssetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAsset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePackagingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePackagingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePackagingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePackagingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAssetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAsset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePackagingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePackagingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePackagingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePackagingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPackagingConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPackagingConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPackagingGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPackagingGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePackagingGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePackagingGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/mediastore/generated.json b/service/mediastore/generated.json index e930e3b0f4e..c0e3cd1602b 100644 --- a/service/mediastore/generated.json +++ b/service/mediastore/generated.json @@ -42,6 +42,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/mediastore/sra_operation_order_test.go b/service/mediastore/sra_operation_order_test.go new file mode 100644 index 00000000000..0965bb0e19e --- /dev/null +++ b/service/mediastore/sra_operation_order_test.go @@ -0,0 +1,756 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package mediastore + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateContainerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateContainer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteContainerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteContainer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteContainerPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteContainerPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCorsPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCorsPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLifecyclePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLifecyclePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMetricPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMetricPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeContainerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeContainer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetContainerPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetContainerPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCorsPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCorsPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLifecyclePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLifecyclePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMetricPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMetricPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListContainersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListContainers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutContainerPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutContainerPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutCorsPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutCorsPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutLifecyclePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutLifecyclePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutMetricPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutMetricPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartAccessLoggingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartAccessLogging(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopAccessLoggingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopAccessLogging(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/mediastoredata/generated.json b/service/mediastoredata/generated.json index 75bdf572599..d644ec1fc91 100644 --- a/service/mediastoredata/generated.json +++ b/service/mediastoredata/generated.json @@ -26,6 +26,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/mediastoredata/sra_operation_order_test.go b/service/mediastoredata/sra_operation_order_test.go new file mode 100644 index 00000000000..2e2e7e2f53e --- /dev/null +++ b/service/mediastoredata/sra_operation_order_test.go @@ -0,0 +1,196 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package mediastoredata + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpDeleteObjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteObject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeObjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeObject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetObjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetObject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListItemsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListItems(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutObjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutObject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/mediatailor/generated.json b/service/mediatailor/generated.json index 9a8395a973d..977066b65ef 100644 --- a/service/mediatailor/generated.json +++ b/service/mediatailor/generated.json @@ -65,6 +65,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/mediatailor/sra_operation_order_test.go b/service/mediatailor/sra_operation_order_test.go new file mode 100644 index 00000000000..c5f4a8bfb4d --- /dev/null +++ b/service/mediatailor/sra_operation_order_test.go @@ -0,0 +1,1561 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package mediatailor + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpConfigureLogsForChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ConfigureLogsForChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpConfigureLogsForPlaybackConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ConfigureLogsForPlaybackConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLiveSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLiveSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePrefetchScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePrefetchSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProgramSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProgram(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSourceLocationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSourceLocation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVodSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVodSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteChannelPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteChannelPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLiveSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLiveSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePlaybackConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePlaybackConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePrefetchScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePrefetchSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProgramSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProgram(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSourceLocationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSourceLocation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVodSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVodSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLiveSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLiveSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeProgramSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeProgram(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSourceLocationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSourceLocation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVodSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVodSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetChannelPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetChannelPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetChannelScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetChannelSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPlaybackConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPlaybackConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPrefetchScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPrefetchSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAlertsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAlerts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListChannelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListChannels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLiveSourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLiveSources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPlaybackConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPlaybackConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPrefetchSchedulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPrefetchSchedules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSourceLocationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSourceLocations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVodSourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVodSources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutChannelPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutChannelPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutPlaybackConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutPlaybackConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLiveSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLiveSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProgramSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProgram(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSourceLocationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSourceLocation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVodSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVodSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/medicalimaging/generated.json b/service/medicalimaging/generated.json index 302d29198a3..a0e39604962 100644 --- a/service/medicalimaging/generated.json +++ b/service/medicalimaging/generated.json @@ -39,6 +39,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/medicalimaging/sra_operation_order_test.go b/service/medicalimaging/sra_operation_order_test.go new file mode 100644 index 00000000000..ea934ddd88b --- /dev/null +++ b/service/medicalimaging/sra_operation_order_test.go @@ -0,0 +1,651 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package medicalimaging + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCopyImageSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopyImageSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDatastoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDatastore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDatastoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDatastore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteImageSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteImageSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDatastoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDatastore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDICOMImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDICOMImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetImageFrameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetImageFrame(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetImageSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetImageSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetImageSetMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetImageSetMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDatastoresSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDatastores(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDICOMImportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDICOMImportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListImageSetVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListImageSetVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchImageSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchImageSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDICOMImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDICOMImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateImageSetMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateImageSetMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/memorydb/generated.json b/service/memorydb/generated.json index 2c798024c0f..dd080bbcb9e 100644 --- a/service/memorydb/generated.json +++ b/service/memorydb/generated.json @@ -64,6 +64,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/memorydb/sra_operation_order_test.go b/service/memorydb/sra_operation_order_test.go new file mode 100644 index 00000000000..2474f4dde70 --- /dev/null +++ b/service/memorydb/sra_operation_order_test.go @@ -0,0 +1,1526 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package memorydb + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchUpdateClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchUpdateCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCopySnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopySnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateACLSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateACL(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMultiRegionClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMultiRegionCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSubnetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSubnetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteACLSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteACL(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMultiRegionClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMultiRegionCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSubnetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSubnetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeACLsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeACLs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEngineVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEngineVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMultiRegionClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMultiRegionClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeParameterGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeParameterGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReservedNodesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReservedNodes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReservedNodesOfferingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReservedNodesOfferings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeServiceUpdatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeServiceUpdates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSnapshotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSnapshots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSubnetGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSubnetGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeUsersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeUsers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpFailoverShardSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.FailoverShard(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAllowedMultiRegionClusterUpdatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAllowedMultiRegionClusterUpdates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAllowedNodeTypeUpdatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAllowedNodeTypeUpdates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPurchaseReservedNodesOfferingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PurchaseReservedNodesOffering(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateACLSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateACL(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMultiRegionClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMultiRegionCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSubnetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSubnetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/mgn/generated.json b/service/mgn/generated.json index 05b8210ff24..e26ae4193ee 100644 --- a/service/mgn/generated.json +++ b/service/mgn/generated.json @@ -91,6 +91,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/mgn/sra_operation_order_test.go b/service/mgn/sra_operation_order_test.go new file mode 100644 index 00000000000..59fa71b270d --- /dev/null +++ b/service/mgn/sra_operation_order_test.go @@ -0,0 +1,2471 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package mgn + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpArchiveApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ArchiveApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpArchiveWaveSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ArchiveWave(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateSourceServersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateSourceServers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpChangeServerLifeCycleStateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ChangeServerLifeCycleState(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLaunchConfigurationTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLaunchConfigurationTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateReplicationConfigurationTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateReplicationConfigurationTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWaveSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWave(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLaunchConfigurationTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLaunchConfigurationTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteReplicationConfigurationTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteReplicationConfigurationTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSourceServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSourceServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVcenterClientSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVcenterClient(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWaveSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWave(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeJobLogItemsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeJobLogItems(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLaunchConfigurationTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLaunchConfigurationTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReplicationConfigurationTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReplicationConfigurationTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSourceServersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSourceServers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVcenterClientsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVcenterClients(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateSourceServersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateSourceServers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisconnectFromServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisconnectFromService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpFinalizeCutoverSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.FinalizeCutover(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLaunchConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLaunchConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReplicationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReplicationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInitializeServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InitializeService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConnectorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConnectors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListExportErrorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListExportErrors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListExportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListExports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListImportErrorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListImportErrors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListImportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListImports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListManagedAccountsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListManagedAccounts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSourceServerActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSourceServerActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTemplateActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTemplateActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWavesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWaves(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMarkAsArchivedSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MarkAsArchived(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPauseReplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PauseReplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutSourceServerActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutSourceServerAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutTemplateActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutTemplateAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveSourceServerActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveSourceServerAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveTemplateActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveTemplateAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResumeReplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResumeReplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRetryDataReplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RetryDataReplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartCutoverSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartCutover(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartImportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartImport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartReplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartReplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartTestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartTest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopReplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopReplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTerminateTargetInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TerminateTargetInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUnarchiveApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UnarchiveApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUnarchiveWaveSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UnarchiveWave(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLaunchConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLaunchConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLaunchConfigurationTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLaunchConfigurationTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateReplicationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateReplicationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateReplicationConfigurationTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateReplicationConfigurationTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSourceServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSourceServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSourceServerReplicationTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSourceServerReplicationType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWaveSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWave(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/migrationhub/generated.json b/service/migrationhub/generated.json index e81d1971ffc..c44330bcbf2 100644 --- a/service/migrationhub/generated.json +++ b/service/migrationhub/generated.json @@ -42,6 +42,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/migrationhub/sra_operation_order_test.go b/service/migrationhub/sra_operation_order_test.go new file mode 100644 index 00000000000..b961be6b7d0 --- /dev/null +++ b/service/migrationhub/sra_operation_order_test.go @@ -0,0 +1,756 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package migrationhub + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateCreatedArtifactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateCreatedArtifact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateDiscoveredResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateDiscoveredResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateSourceResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateSourceResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProgressUpdateStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProgressUpdateStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProgressUpdateStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProgressUpdateStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeApplicationStateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeApplicationState(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMigrationTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMigrationTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateCreatedArtifactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateCreatedArtifact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateDiscoveredResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateDiscoveredResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateSourceResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateSourceResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportMigrationTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportMigrationTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationStatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplicationStates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCreatedArtifactsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCreatedArtifacts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDiscoveredResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDiscoveredResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMigrationTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMigrationTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMigrationTaskUpdatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMigrationTaskUpdates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProgressUpdateStreamsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProgressUpdateStreams(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSourceResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSourceResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNotifyApplicationStateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NotifyApplicationState(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNotifyMigrationTaskStateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NotifyMigrationTaskState(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResourceAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResourceAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/migrationhubconfig/generated.json b/service/migrationhubconfig/generated.json index e7307a1e3da..e60b8c15dd2 100644 --- a/service/migrationhubconfig/generated.json +++ b/service/migrationhubconfig/generated.json @@ -25,6 +25,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/migrationhubconfig/sra_operation_order_test.go b/service/migrationhubconfig/sra_operation_order_test.go new file mode 100644 index 00000000000..b7ab5e4397e --- /dev/null +++ b/service/migrationhubconfig/sra_operation_order_test.go @@ -0,0 +1,161 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package migrationhubconfig + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateHomeRegionControlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateHomeRegionControl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteHomeRegionControlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteHomeRegionControl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeHomeRegionControlsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeHomeRegionControls(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetHomeRegionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetHomeRegion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/migrationhuborchestrator/generated.json b/service/migrationhuborchestrator/generated.json index 0cc40618a38..01201beaf00 100644 --- a/service/migrationhuborchestrator/generated.json +++ b/service/migrationhuborchestrator/generated.json @@ -52,6 +52,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/migrationhuborchestrator/sra_operation_order_test.go b/service/migrationhuborchestrator/sra_operation_order_test.go new file mode 100644 index 00000000000..8385c42f17f --- /dev/null +++ b/service/migrationhuborchestrator/sra_operation_order_test.go @@ -0,0 +1,1106 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package migrationhuborchestrator + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorkflowStepSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorkflowStep(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorkflowStepGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorkflowStepGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWorkflowStepSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWorkflowStep(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWorkflowStepGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWorkflowStepGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTemplateStepSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTemplateStep(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTemplateStepGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTemplateStepGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWorkflowStepSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWorkflowStep(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWorkflowStepGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWorkflowStepGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPluginsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPlugins(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTemplateStepGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTemplateStepGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTemplateStepsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTemplateSteps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkflowsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkflows(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkflowStepGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkflowStepGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkflowStepsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkflowSteps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRetryWorkflowStepSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RetryWorkflowStep(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWorkflowStepSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWorkflowStep(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWorkflowStepGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWorkflowStepGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/migrationhubrefactorspaces/generated.json b/service/migrationhubrefactorspaces/generated.json index a7fa9f88c48..8acaf91399e 100644 --- a/service/migrationhubrefactorspaces/generated.json +++ b/service/migrationhubrefactorspaces/generated.json @@ -45,6 +45,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/migrationhubrefactorspaces/sra_operation_order_test.go b/service/migrationhubrefactorspaces/sra_operation_order_test.go new file mode 100644 index 00000000000..41bf758b117 --- /dev/null +++ b/service/migrationhubrefactorspaces/sra_operation_order_test.go @@ -0,0 +1,861 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package migrationhubrefactorspaces + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEnvironmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEnvironments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEnvironmentVpcsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEnvironmentVpcs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRoutesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRoutes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRouteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRoute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/migrationhubstrategy/generated.json b/service/migrationhubstrategy/generated.json index ca3b274690d..509ce5575de 100644 --- a/service/migrationhubstrategy/generated.json +++ b/service/migrationhubstrategy/generated.json @@ -43,6 +43,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/migrationhubstrategy/sra_operation_order_test.go b/service/migrationhubstrategy/sra_operation_order_test.go new file mode 100644 index 00000000000..d169b68c899 --- /dev/null +++ b/service/migrationhubstrategy/sra_operation_order_test.go @@ -0,0 +1,791 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package migrationhubstrategy + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpGetApplicationComponentDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApplicationComponentDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApplicationComponentStrategiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApplicationComponentStrategies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAssessmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAssessment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetImportFileTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetImportFileTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLatestAssessmentIdSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLatestAssessmentId(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPortfolioPreferencesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPortfolioPreferences(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPortfolioSummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPortfolioSummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRecommendationReportDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRecommendationReportDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServerDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServerDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServerStrategiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServerStrategies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAnalyzableServersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAnalyzableServers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationComponentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplicationComponents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCollectorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCollectors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListImportFileTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListImportFileTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutPortfolioPreferencesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutPortfolioPreferences(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartAssessmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartAssessment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartImportFileTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartImportFileTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartRecommendationReportGenerationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartRecommendationReportGeneration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopAssessmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopAssessment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApplicationComponentConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApplicationComponentConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateServerConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateServerConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/mq/generated.json b/service/mq/generated.json index 271960b7feb..486f311f8c4 100644 --- a/service/mq/generated.json +++ b/service/mq/generated.json @@ -44,6 +44,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/mq/sra_operation_order_test.go b/service/mq/sra_operation_order_test.go new file mode 100644 index 00000000000..b7880d6a452 --- /dev/null +++ b/service/mq/sra_operation_order_test.go @@ -0,0 +1,826 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package mq + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateBrokerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBroker(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBrokerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBroker(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBrokerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBroker(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBrokerEngineTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBrokerEngineTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBrokerInstanceOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBrokerInstanceOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConfigurationRevisionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConfigurationRevision(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBrokersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBrokers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConfigurationRevisionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConfigurationRevisions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUsersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUsers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPromoteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Promote(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRebootBrokerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RebootBroker(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBrokerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBroker(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/mturk/generated.json b/service/mturk/generated.json index e0d7b3e7fcd..15c443d2b78 100644 --- a/service/mturk/generated.json +++ b/service/mturk/generated.json @@ -60,6 +60,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/mturk/sra_operation_order_test.go b/service/mturk/sra_operation_order_test.go new file mode 100644 index 00000000000..418d7c9b045 --- /dev/null +++ b/service/mturk/sra_operation_order_test.go @@ -0,0 +1,1386 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package mturk + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcceptQualificationRequestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptQualificationRequest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpApproveAssignmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ApproveAssignment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateQualificationWithWorkerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateQualificationWithWorker(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAdditionalAssignmentsForHITSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAdditionalAssignmentsForHIT(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateHITSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateHIT(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateHITTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateHITType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateHITWithHITTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateHITWithHITType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateQualificationTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateQualificationType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorkerBlockSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorkerBlock(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteHITSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteHIT(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteQualificationTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteQualificationType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWorkerBlockSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWorkerBlock(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateQualificationFromWorkerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateQualificationFromWorker(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccountBalanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccountBalance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAssignmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAssignment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFileUploadURLSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFileUploadURL(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetHITSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetHIT(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQualificationScoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQualificationScore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQualificationTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQualificationType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssignmentsForHITSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssignmentsForHIT(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBonusPaymentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBonusPayments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListHITsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListHITs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListHITsForQualificationTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListHITsForQualificationType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListQualificationRequestsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListQualificationRequests(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListQualificationTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListQualificationTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReviewableHITsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReviewableHITs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReviewPolicyResultsForHITSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReviewPolicyResultsForHIT(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkerBlocksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkerBlocks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkersWithQualificationTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkersWithQualificationType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNotifyWorkersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NotifyWorkers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRejectAssignmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RejectAssignment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRejectQualificationRequestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RejectQualificationRequest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendBonusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendBonus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendTestEventNotificationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendTestEventNotification(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateExpirationForHITSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateExpirationForHIT(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateHITReviewStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateHITReviewStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateHITTypeOfHITSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateHITTypeOfHIT(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateNotificationSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateNotificationSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateQualificationTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateQualificationType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/mwaa/generated.json b/service/mwaa/generated.json index ad2dfdd4ec7..48e42a6e1fb 100644 --- a/service/mwaa/generated.json +++ b/service/mwaa/generated.json @@ -37,6 +37,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/mwaa/sra_operation_order_test.go b/service/mwaa/sra_operation_order_test.go new file mode 100644 index 00000000000..57fb45f9565 --- /dev/null +++ b/service/mwaa/sra_operation_order_test.go @@ -0,0 +1,441 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package mwaa + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateCliTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCliToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWebLoginTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWebLoginToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInvokeRestApiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InvokeRestApi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEnvironmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEnvironments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPublishMetricsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PublishMetrics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/neptune/generated.json b/service/neptune/generated.json index 1f77ac67bac..304b13e2a50 100644 --- a/service/neptune/generated.json +++ b/service/neptune/generated.json @@ -94,6 +94,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/neptune/sra_operation_order_test.go b/service/neptune/sra_operation_order_test.go new file mode 100644 index 00000000000..d8378077c7b --- /dev/null +++ b/service/neptune/sra_operation_order_test.go @@ -0,0 +1,2436 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package neptune + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddRoleToDBClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddRoleToDBCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddSourceIdentifierToSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddSourceIdentifierToSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddTagsToResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddTagsToResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpApplyPendingMaintenanceActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ApplyPendingMaintenanceAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCopyDBClusterParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopyDBClusterParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCopyDBClusterSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopyDBClusterSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCopyDBParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopyDBParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDBClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDBCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDBClusterEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDBClusterEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDBClusterParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDBClusterParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDBClusterSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDBClusterSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDBInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDBInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDBParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDBParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDBSubnetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDBSubnetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEventSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEventSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGlobalClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGlobalCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDBClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDBCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDBClusterEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDBClusterEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDBClusterParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDBClusterParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDBClusterSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDBClusterSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDBInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDBInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDBParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDBParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDBSubnetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDBSubnetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEventSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEventSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGlobalClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGlobalCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBClusterEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBClusterEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBClusterParameterGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBClusterParameterGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBClusterParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBClusterParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBClusterSnapshotAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBClusterSnapshotAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBClusterSnapshotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBClusterSnapshots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBEngineVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBEngineVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBParameterGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBParameterGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBSubnetGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBSubnetGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEngineDefaultClusterParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEngineDefaultClusterParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEngineDefaultParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEngineDefaultParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventCategoriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEventCategories(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventSubscriptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEventSubscriptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGlobalClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGlobalClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOrderableDBInstanceOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOrderableDBInstanceOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePendingMaintenanceActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePendingMaintenanceActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeValidDBInstanceModificationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeValidDBInstanceModifications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpFailoverDBClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.FailoverDBCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpFailoverGlobalClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.FailoverGlobalCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDBClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDBCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDBClusterEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDBClusterEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDBClusterParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDBClusterParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDBClusterSnapshotAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDBClusterSnapshotAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDBInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDBInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDBParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDBParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDBSubnetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDBSubnetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyEventSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyEventSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyGlobalClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyGlobalCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPromoteReadReplicaDBClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PromoteReadReplicaDBCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRebootDBInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RebootDBInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveFromGlobalClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveFromGlobalCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveRoleFromDBClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveRoleFromDBCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveSourceIdentifierFromSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveSourceIdentifierFromSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveTagsFromResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveTagsFromResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetDBClusterParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetDBClusterParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetDBParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetDBParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreDBClusterFromSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreDBClusterFromSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreDBClusterToPointInTimeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreDBClusterToPointInTime(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDBClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDBCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopDBClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopDBCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/neptunedata/generated.json b/service/neptunedata/generated.json index 87d75d67726..d07894ccae6 100644 --- a/service/neptunedata/generated.json +++ b/service/neptunedata/generated.json @@ -68,6 +68,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/neptunedata/sra_operation_order_test.go b/service/neptunedata/sra_operation_order_test.go new file mode 100644 index 00000000000..599cd385b8f --- /dev/null +++ b/service/neptunedata/sra_operation_order_test.go @@ -0,0 +1,1526 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package neptunedata + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCancelGremlinQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelGremlinQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelLoaderJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelLoaderJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelMLDataProcessingJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelMLDataProcessingJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelMLModelTrainingJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelMLModelTrainingJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelMLModelTransformJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelMLModelTransformJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelOpenCypherQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelOpenCypherQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMLEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMLEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMLEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMLEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePropertygraphStatisticsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePropertygraphStatistics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSparqlStatisticsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSparqlStatistics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExecuteFastResetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExecuteFastReset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExecuteGremlinExplainQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExecuteGremlinExplainQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExecuteGremlinProfileQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExecuteGremlinProfileQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExecuteGremlinQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExecuteGremlinQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExecuteOpenCypherExplainQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExecuteOpenCypherExplainQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExecuteOpenCypherQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExecuteOpenCypherQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEngineStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEngineStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGremlinQueryStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGremlinQueryStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLoaderJobStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLoaderJobStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMLDataProcessingJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMLDataProcessingJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMLEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMLEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMLModelTrainingJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMLModelTrainingJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMLModelTransformJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMLModelTransformJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOpenCypherQueryStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOpenCypherQueryStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPropertygraphStatisticsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPropertygraphStatistics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPropertygraphStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPropertygraphStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPropertygraphSummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPropertygraphSummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRDFGraphSummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRDFGraphSummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSparqlStatisticsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSparqlStatistics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSparqlStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSparqlStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGremlinQueriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGremlinQueries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLoaderJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLoaderJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMLDataProcessingJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMLDataProcessingJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMLEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMLEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMLModelTrainingJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMLModelTrainingJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMLModelTransformJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMLModelTransformJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOpenCypherQueriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOpenCypherQueries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpManagePropertygraphStatisticsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ManagePropertygraphStatistics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpManageSparqlStatisticsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ManageSparqlStatistics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartLoaderJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartLoaderJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMLDataProcessingJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMLDataProcessingJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMLModelTrainingJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMLModelTrainingJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMLModelTransformJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMLModelTransformJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/neptunegraph/generated.json b/service/neptunegraph/generated.json index 8d011f99fac..f3702aa112f 100644 --- a/service/neptunegraph/generated.json +++ b/service/neptunegraph/generated.json @@ -57,6 +57,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/neptunegraph/sra_operation_order_test.go b/service/neptunegraph/sra_operation_order_test.go new file mode 100644 index 00000000000..3cdd956f8eb --- /dev/null +++ b/service/neptunegraph/sra_operation_order_test.go @@ -0,0 +1,1141 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package neptunegraph + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCancelExportTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelExportTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelImportTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelImportTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGraphSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGraph(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGraphSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGraphSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGraphUsingImportTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGraphUsingImportTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePrivateGraphEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePrivateGraphEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGraphSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGraph(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGraphSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGraphSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePrivateGraphEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePrivateGraphEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExecuteQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExecuteQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetExportTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetExportTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGraphSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGraph(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGraphSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGraphSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGraphSummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGraphSummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetImportTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetImportTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPrivateGraphEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPrivateGraphEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListExportTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListExportTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGraphsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGraphs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGraphSnapshotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGraphSnapshots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListImportTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListImportTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPrivateGraphEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPrivateGraphEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListQueriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListQueries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetGraphSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetGraph(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreGraphFromSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreGraphFromSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartExportTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartExportTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartImportTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartImportTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGraphSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGraph(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/networkfirewall/generated.json b/service/networkfirewall/generated.json index e3230c3ea1d..17608dc8c22 100644 --- a/service/networkfirewall/generated.json +++ b/service/networkfirewall/generated.json @@ -61,6 +61,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/networkfirewall/sra_operation_order_test.go b/service/networkfirewall/sra_operation_order_test.go new file mode 100644 index 00000000000..1ea4424b497 --- /dev/null +++ b/service/networkfirewall/sra_operation_order_test.go @@ -0,0 +1,1421 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package networkfirewall + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateFirewallPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateFirewallPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateSubnetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateSubnets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFirewallSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFirewall(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFirewallPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFirewallPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRuleGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRuleGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTLSInspectionConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTLSInspectionConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFirewallSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFirewall(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFirewallPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFirewallPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRuleGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRuleGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTLSInspectionConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTLSInspectionConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFirewallSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFirewall(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFirewallPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFirewallPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLoggingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLoggingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRuleGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRuleGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRuleGroupMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRuleGroupMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTLSInspectionConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTLSInspectionConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateSubnetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateSubnets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAnalysisReportResultsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAnalysisReportResults(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAnalysisReportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAnalysisReports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFirewallPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFirewallPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFirewallsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFirewalls(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRuleGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRuleGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTLSInspectionConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTLSInspectionConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartAnalysisReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartAnalysisReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFirewallAnalysisSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFirewallAnalysisSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFirewallDeleteProtectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFirewallDeleteProtection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFirewallDescriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFirewallDescription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFirewallEncryptionConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFirewallEncryptionConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFirewallPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFirewallPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFirewallPolicyChangeProtectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFirewallPolicyChangeProtection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLoggingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLoggingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRuleGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRuleGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSubnetChangeProtectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSubnetChangeProtection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTLSInspectionConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTLSInspectionConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/networkflowmonitor/generated.json b/service/networkflowmonitor/generated.json index c8259a5a3c3..21f64ff4971 100644 --- a/service/networkflowmonitor/generated.json +++ b/service/networkflowmonitor/generated.json @@ -46,6 +46,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/networkflowmonitor/sra_operation_order_test.go b/service/networkflowmonitor/sra_operation_order_test.go new file mode 100644 index 00000000000..a3a2a964ae7 --- /dev/null +++ b/service/networkflowmonitor/sra_operation_order_test.go @@ -0,0 +1,896 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package networkflowmonitor + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateMonitorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMonitor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateScopeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateScope(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMonitorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMonitor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteScopeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteScope(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMonitorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMonitor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQueryResultsMonitorTopContributorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQueryResultsMonitorTopContributors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQueryResultsWorkloadInsightsTopContributorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQueryResultsWorkloadInsightsTopContributors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQueryResultsWorkloadInsightsTopContributorsDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQueryResultsWorkloadInsightsTopContributorsData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQueryStatusMonitorTopContributorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQueryStatusMonitorTopContributors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQueryStatusWorkloadInsightsTopContributorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQueryStatusWorkloadInsightsTopContributors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQueryStatusWorkloadInsightsTopContributorsDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQueryStatusWorkloadInsightsTopContributorsData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetScopeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetScope(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMonitorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMonitors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListScopesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListScopes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartQueryMonitorTopContributorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartQueryMonitorTopContributors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartQueryWorkloadInsightsTopContributorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartQueryWorkloadInsightsTopContributors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartQueryWorkloadInsightsTopContributorsDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartQueryWorkloadInsightsTopContributorsData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopQueryMonitorTopContributorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopQueryMonitorTopContributors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopQueryWorkloadInsightsTopContributorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopQueryWorkloadInsightsTopContributors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopQueryWorkloadInsightsTopContributorsDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopQueryWorkloadInsightsTopContributorsData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMonitorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMonitor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateScopeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateScope(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/networkmanager/generated.json b/service/networkmanager/generated.json index b05785142ea..811bdd3d7ec 100644 --- a/service/networkmanager/generated.json +++ b/service/networkmanager/generated.json @@ -109,6 +109,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/networkmanager/sra_operation_order_test.go b/service/networkmanager/sra_operation_order_test.go new file mode 100644 index 00000000000..a1e82a4fde6 --- /dev/null +++ b/service/networkmanager/sra_operation_order_test.go @@ -0,0 +1,3101 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package networkmanager + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcceptAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateConnectPeerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateConnectPeer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateCustomerGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateCustomerGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateTransitGatewayConnectPeerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateTransitGatewayConnectPeer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConnectAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConnectAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConnectPeerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConnectPeer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCoreNetworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCoreNetwork(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDirectConnectGatewayAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDirectConnectGatewayAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGlobalNetworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGlobalNetwork(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSiteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSite(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSiteToSiteVpnAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSiteToSiteVpnAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTransitGatewayPeeringSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTransitGatewayPeering(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTransitGatewayRouteTableAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTransitGatewayRouteTableAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVpcAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVpcAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConnectPeerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConnectPeer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCoreNetworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCoreNetwork(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCoreNetworkPolicyVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCoreNetworkPolicyVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGlobalNetworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGlobalNetwork(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePeeringSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePeering(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSiteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSite(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterTransitGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterTransitGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGlobalNetworksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGlobalNetworks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateConnectPeerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateConnectPeer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateCustomerGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateCustomerGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateTransitGatewayConnectPeerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateTransitGatewayConnectPeer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExecuteCoreNetworkChangeSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExecuteCoreNetworkChangeSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConnectAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConnectAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConnectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConnections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConnectPeerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConnectPeer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConnectPeerAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConnectPeerAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCoreNetworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCoreNetwork(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCoreNetworkChangeEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCoreNetworkChangeEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCoreNetworkChangeSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCoreNetworkChangeSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCoreNetworkPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCoreNetworkPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCustomerGatewayAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCustomerGatewayAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDevicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDevices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDirectConnectGatewayAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDirectConnectGatewayAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLinkAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLinkAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLinksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLinks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetNetworkResourceCountsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetNetworkResourceCounts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetNetworkResourceRelationshipsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetNetworkResourceRelationships(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetNetworkResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetNetworkResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetNetworkRoutesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetNetworkRoutes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetNetworkTelemetrySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetNetworkTelemetry(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRouteAnalysisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRouteAnalysis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSitesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSites(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSiteToSiteVpnAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSiteToSiteVpnAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTransitGatewayConnectPeerAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTransitGatewayConnectPeerAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTransitGatewayPeeringSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTransitGatewayPeering(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTransitGatewayRegistrationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTransitGatewayRegistrations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTransitGatewayRouteTableAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTransitGatewayRouteTableAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVpcAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVpcAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAttachmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAttachments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConnectPeersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConnectPeers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCoreNetworkPolicyVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCoreNetworkPolicyVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCoreNetworksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCoreNetworks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOrganizationServiceAccessStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOrganizationServiceAccessStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPeeringsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPeerings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutCoreNetworkPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutCoreNetworkPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterTransitGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterTransitGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRejectAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RejectAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreCoreNetworkPolicyVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreCoreNetworkPolicyVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartOrganizationServiceAccessUpdateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartOrganizationServiceAccessUpdate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartRouteAnalysisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartRouteAnalysis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCoreNetworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCoreNetwork(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDirectConnectGatewayAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDirectConnectGatewayAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGlobalNetworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGlobalNetwork(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateNetworkResourceMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateNetworkResourceMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSiteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSite(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVpcAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVpcAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/networkmonitor/generated.json b/service/networkmonitor/generated.json index b9b84f4d551..f7e1b615597 100644 --- a/service/networkmonitor/generated.json +++ b/service/networkmonitor/generated.json @@ -33,6 +33,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/networkmonitor/sra_operation_order_test.go b/service/networkmonitor/sra_operation_order_test.go new file mode 100644 index 00000000000..c0f6e550c52 --- /dev/null +++ b/service/networkmonitor/sra_operation_order_test.go @@ -0,0 +1,441 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package networkmonitor + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateMonitorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMonitor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProbeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProbe(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMonitorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMonitor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProbeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProbe(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMonitorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMonitor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetProbeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetProbe(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMonitorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMonitors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMonitorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMonitor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProbeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProbe(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/notifications/generated.json b/service/notifications/generated.json index f1883d44c8a..62126b8d5a1 100644 --- a/service/notifications/generated.json +++ b/service/notifications/generated.json @@ -56,6 +56,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/notifications/sra_operation_order_test.go b/service/notifications/sra_operation_order_test.go new file mode 100644 index 00000000000..182fcbd01af --- /dev/null +++ b/service/notifications/sra_operation_order_test.go @@ -0,0 +1,1246 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateManagedNotificationAccountContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateManagedNotificationAccountContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateManagedNotificationAdditionalChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateManagedNotificationAdditionalChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEventRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEventRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateNotificationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNotificationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEventRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEventRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNotificationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNotificationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterNotificationHubSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterNotificationHub(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableNotificationsAccessForOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableNotificationsAccessForOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateManagedNotificationAccountContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateManagedNotificationAccountContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateManagedNotificationAdditionalChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateManagedNotificationAdditionalChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableNotificationsAccessForOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableNotificationsAccessForOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEventRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEventRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetManagedNotificationChildEventSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetManagedNotificationChildEvent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetManagedNotificationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetManagedNotificationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetManagedNotificationEventSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetManagedNotificationEvent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetNotificationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetNotificationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetNotificationEventSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetNotificationEvent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetNotificationsAccessForOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetNotificationsAccessForOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListChannelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListChannels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEventRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEventRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListManagedNotificationChannelAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListManagedNotificationChannelAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListManagedNotificationChildEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListManagedNotificationChildEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListManagedNotificationConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListManagedNotificationConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListManagedNotificationEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListManagedNotificationEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNotificationConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNotificationConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNotificationEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNotificationEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNotificationHubsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNotificationHubs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterNotificationHubSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterNotificationHub(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEventRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEventRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateNotificationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateNotificationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/notificationscontacts/generated.json b/service/notificationscontacts/generated.json index 0fe8bade7a6..63ba7f89f9c 100644 --- a/service/notificationscontacts/generated.json +++ b/service/notificationscontacts/generated.json @@ -30,6 +30,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/notificationscontacts/sra_operation_order_test.go b/service/notificationscontacts/sra_operation_order_test.go new file mode 100644 index 00000000000..f26d7c1ecc3 --- /dev/null +++ b/service/notificationscontacts/sra_operation_order_test.go @@ -0,0 +1,336 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notificationscontacts + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpActivateEmailContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ActivateEmailContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEmailContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEmailContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEmailContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEmailContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEmailContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEmailContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEmailContactsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEmailContacts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendActivationCodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendActivationCode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/oam/generated.json b/service/oam/generated.json index 10e823b8e21..91aa2959268 100644 --- a/service/oam/generated.json +++ b/service/oam/generated.json @@ -36,6 +36,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/oam/sra_operation_order_test.go b/service/oam/sra_operation_order_test.go new file mode 100644 index 00000000000..37edd340e27 --- /dev/null +++ b/service/oam/sra_operation_order_test.go @@ -0,0 +1,546 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package oam + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSinkPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSinkPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAttachedLinksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAttachedLinks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLinksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLinks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSinksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSinks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutSinkPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutSinkPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/observabilityadmin/generated.json b/service/observabilityadmin/generated.json index 1ecb75f0428..1fb1d695915 100644 --- a/service/observabilityadmin/generated.json +++ b/service/observabilityadmin/generated.json @@ -29,6 +29,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/observabilityadmin/sra_operation_order_test.go b/service/observabilityadmin/sra_operation_order_test.go new file mode 100644 index 00000000000..c7e96820945 --- /dev/null +++ b/service/observabilityadmin/sra_operation_order_test.go @@ -0,0 +1,301 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package observabilityadmin + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpGetTelemetryEvaluationStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTelemetryEvaluationStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTelemetryEvaluationStatusForOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTelemetryEvaluationStatusForOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceTelemetrySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceTelemetry(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceTelemetryForOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceTelemetryForOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartTelemetryEvaluationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartTelemetryEvaluation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartTelemetryEvaluationForOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartTelemetryEvaluationForOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopTelemetryEvaluationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopTelemetryEvaluation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopTelemetryEvaluationForOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopTelemetryEvaluationForOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/omics/generated.json b/service/omics/generated.json index 63075da0a2e..73decb1984e 100644 --- a/service/omics/generated.json +++ b/service/omics/generated.json @@ -116,6 +116,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/omics/sra_operation_order_test.go b/service/omics/sra_operation_order_test.go new file mode 100644 index 00000000000..79d44104a7c --- /dev/null +++ b/service/omics/sra_operation_order_test.go @@ -0,0 +1,3206 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package omics + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAbortMultipartReadSetUploadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AbortMultipartReadSetUpload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAcceptShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeleteReadSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteReadSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelAnnotationImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelAnnotationImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelVariantImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelVariantImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCompleteMultipartReadSetUploadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CompleteMultipartReadSetUpload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAnnotationStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAnnotationStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAnnotationStoreVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAnnotationStoreVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMultipartReadSetUploadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMultipartReadSetUpload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateReferenceStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateReferenceStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRunCacheSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRunCache(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRunGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRunGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSequenceStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSequenceStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVariantStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVariantStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAnnotationStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAnnotationStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAnnotationStoreVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAnnotationStoreVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteReferenceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteReference(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteReferenceStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteReferenceStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRunCacheSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRunCache(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRunGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRunGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteS3AccessPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteS3AccessPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSequenceStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSequenceStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVariantStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVariantStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAnnotationImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAnnotationImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAnnotationStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAnnotationStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAnnotationStoreVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAnnotationStoreVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReadSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReadSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReadSetActivationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReadSetActivationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReadSetExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReadSetExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReadSetImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReadSetImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReadSetMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReadSetMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReferenceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReference(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReferenceImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReferenceImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReferenceMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReferenceMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReferenceStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReferenceStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRunCacheSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRunCache(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRunGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRunGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRunTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRunTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetS3AccessPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetS3AccessPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSequenceStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSequenceStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVariantImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVariantImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVariantStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVariantStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAnnotationImportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAnnotationImportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAnnotationStoresSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAnnotationStores(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAnnotationStoreVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAnnotationStoreVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMultipartReadSetUploadsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMultipartReadSetUploads(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReadSetActivationJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReadSetActivationJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReadSetExportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReadSetExportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReadSetImportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReadSetImportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReadSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReadSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReadSetUploadPartsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReadSetUploadParts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReferenceImportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReferenceImportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReferencesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReferences(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReferenceStoresSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReferenceStores(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRunCachesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRunCaches(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRunGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRunGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRunsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRuns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRunTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRunTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSequenceStoresSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSequenceStores(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSharesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListShares(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVariantImportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVariantImportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVariantStoresSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVariantStores(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkflowsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkflows(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutS3AccessPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutS3AccessPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartAnnotationImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartAnnotationImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartReadSetActivationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartReadSetActivationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartReadSetExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartReadSetExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartReadSetImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartReadSetImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartReferenceImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartReferenceImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartVariantImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartVariantImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAnnotationStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAnnotationStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAnnotationStoreVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAnnotationStoreVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRunCacheSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRunCache(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRunGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRunGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSequenceStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSequenceStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVariantStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVariantStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUploadReadSetPartSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UploadReadSetPart(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/opensearch/generated.json b/service/opensearch/generated.json index 20a843c9a73..9818965f1f7 100644 --- a/service/opensearch/generated.json +++ b/service/opensearch/generated.json @@ -97,6 +97,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/opensearch/sra_operation_order_test.go b/service/opensearch/sra_operation_order_test.go new file mode 100644 index 00000000000..21cd3ea9bb1 --- /dev/null +++ b/service/opensearch/sra_operation_order_test.go @@ -0,0 +1,2681 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package opensearch + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcceptInboundConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptInboundConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddDirectQueryDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddDirectQueryDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociatePackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociatePackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociatePackagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociatePackages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAuthorizeVpcEndpointAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AuthorizeVpcEndpointAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelDomainConfigChangeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelDomainConfigChange(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelServiceSoftwareUpdateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelServiceSoftwareUpdate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateOutboundConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateOutboundConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVpcEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVpcEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDirectQueryDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDirectQueryDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInboundConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInboundConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteOutboundConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteOutboundConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVpcEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVpcEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDomainAutoTunesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDomainAutoTunes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDomainChangeProgressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDomainChangeProgress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDomainConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDomainConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDomainHealthSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDomainHealth(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDomainNodesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDomainNodes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDomainsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDomains(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDryRunProgressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDryRunProgress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInboundConnectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInboundConnections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInstanceTypeLimitsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInstanceTypeLimits(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOutboundConnectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOutboundConnections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePackagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePackages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReservedInstanceOfferingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReservedInstanceOfferings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReservedInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReservedInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVpcEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVpcEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDissociatePackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DissociatePackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDissociatePackagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DissociatePackages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCompatibleVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCompatibleVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDirectQueryDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDirectQueryDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDomainMaintenanceStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDomainMaintenanceStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPackageVersionHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPackageVersionHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUpgradeHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUpgradeHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUpgradeStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUpgradeStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataSourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataSources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDirectQueryDataSourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDirectQueryDataSources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDomainMaintenancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDomainMaintenances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDomainNamesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDomainNames(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDomainsForPackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDomainsForPackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInstanceTypeDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInstanceTypeDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPackagesForDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPackagesForDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListScheduledActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListScheduledActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVpcEndpointAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVpcEndpointAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVpcEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVpcEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVpcEndpointsForDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVpcEndpointsForDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPurchaseReservedInstanceOfferingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PurchaseReservedInstanceOffering(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRejectInboundConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RejectInboundConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRevokeVpcEndpointAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RevokeVpcEndpointAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDomainMaintenanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDomainMaintenance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartServiceSoftwareUpdateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartServiceSoftwareUpdate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDirectQueryDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDirectQueryDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDomainConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDomainConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePackageScopeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePackageScope(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateScheduledActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateScheduledAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVpcEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVpcEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpgradeDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpgradeDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/opensearchserverless/generated.json b/service/opensearchserverless/generated.json index bb47901302a..3cfbba5e851 100644 --- a/service/opensearchserverless/generated.json +++ b/service/opensearchserverless/generated.json @@ -62,6 +62,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/opensearchserverless/sra_operation_order_test.go b/service/opensearchserverless/sra_operation_order_test.go new file mode 100644 index 00000000000..1685aa0f681 --- /dev/null +++ b/service/opensearchserverless/sra_operation_order_test.go @@ -0,0 +1,1316 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package opensearchserverless + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchGetCollectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetCollection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetEffectiveLifecyclePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetEffectiveLifecyclePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetLifecyclePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetLifecyclePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetVpcEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetVpcEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAccessPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAccessPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCollectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCollection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLifecyclePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLifecyclePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSecurityConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSecurityConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSecurityPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSecurityPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVpcEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVpcEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccessPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccessPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCollectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCollection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLifecyclePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLifecyclePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSecurityConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSecurityConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSecurityPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSecurityPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVpcEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVpcEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccessPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccessPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccountSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccountSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPoliciesStatsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPoliciesStats(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSecurityConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSecurityConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSecurityPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSecurityPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccessPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccessPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCollectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCollections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLifecyclePoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLifecyclePolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSecurityConfigsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSecurityConfigs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSecurityPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSecurityPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVpcEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVpcEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAccessPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAccessPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAccountSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAccountSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCollectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCollection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLifecyclePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLifecyclePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSecurityConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSecurityConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSecurityPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSecurityPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVpcEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVpcEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/opsworks/generated.json b/service/opsworks/generated.json index 03bc17aa367..21e18839455 100644 --- a/service/opsworks/generated.json +++ b/service/opsworks/generated.json @@ -95,6 +95,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/opsworks/sra_operation_order_test.go b/service/opsworks/sra_operation_order_test.go new file mode 100644 index 00000000000..7a011626aaf --- /dev/null +++ b/service/opsworks/sra_operation_order_test.go @@ -0,0 +1,2611 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package opsworks + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssignInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssignInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssignVolumeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssignVolume(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateElasticIpSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateElasticIp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachElasticLoadBalancerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachElasticLoadBalancer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCloneStackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CloneStack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLayerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLayer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUserProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUserProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLayerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLayer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteStackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteStack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUserProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterEcsClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterEcsCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterElasticIpSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterElasticIp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterRdsDbInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterRdsDbInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterVolumeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterVolume(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAgentVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAgentVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAppsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeApps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCommandsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCommands(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDeploymentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDeployments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEcsClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEcsClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeElasticIpsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeElasticIps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeElasticLoadBalancersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeElasticLoadBalancers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLayersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLayers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLoadBasedAutoScalingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLoadBasedAutoScaling(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMyUserProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMyUserProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOperatingSystemsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOperatingSystems(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRaidArraysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRaidArrays(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRdsDbInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRdsDbInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeServiceErrorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeServiceErrors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStackProvisioningParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStackProvisioningParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStacksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStacks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStackSummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStackSummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTimeBasedAutoScalingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTimeBasedAutoScaling(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeUserProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeUserProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVolumesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVolumes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachElasticLoadBalancerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachElasticLoadBalancer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateElasticIpSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateElasticIp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetHostnameSuggestionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetHostnameSuggestion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGrantAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GrantAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRebootInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RebootInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterEcsClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterEcsCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterElasticIpSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterElasticIp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterRdsDbInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterRdsDbInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterVolumeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterVolume(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetLoadBasedAutoScalingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetLoadBasedAutoScaling(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetPermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetPermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetTimeBasedAutoScalingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetTimeBasedAutoScaling(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartStackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartStack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopStackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopStack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUnassignInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UnassignInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUnassignVolumeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UnassignVolume(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateElasticIpSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateElasticIp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLayerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLayer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMyUserProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMyUserProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRdsDbInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRdsDbInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateStackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateStack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUserProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVolumeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVolume(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/opsworkscm/generated.json b/service/opsworkscm/generated.json index 5ae5e471546..64f9eadab22 100644 --- a/service/opsworkscm/generated.json +++ b/service/opsworkscm/generated.json @@ -40,6 +40,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/opsworkscm/sra_operation_order_test.go b/service/opsworkscm/sra_operation_order_test.go new file mode 100644 index 00000000000..a92f0d91b88 --- /dev/null +++ b/service/opsworkscm/sra_operation_order_test.go @@ -0,0 +1,686 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package opsworkscm + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateNodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateNode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBackupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBackup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBackupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBackup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccountAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccountAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBackupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBackups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeNodeAssociationStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeNodeAssociationStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeServersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeServers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateNodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateNode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportServerEngineAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportServerEngineAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMaintenanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMaintenance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateServerEngineAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateServerEngineAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/organizations/generated.json b/service/organizations/generated.json index f81c17117f6..08ece08d9e3 100644 --- a/service/organizations/generated.json +++ b/service/organizations/generated.json @@ -76,6 +76,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/organizations/sra_operation_order_test.go b/service/organizations/sra_operation_order_test.go new file mode 100644 index 00000000000..3ff4ed6ab3f --- /dev/null +++ b/service/organizations/sra_operation_order_test.go @@ -0,0 +1,1946 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package organizations + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcceptHandshakeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptHandshake(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelHandshakeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelHandshake(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCloseAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CloseAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGovCloudAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGovCloudAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateOrganizationalUnitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateOrganizationalUnit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeclineHandshakeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeclineHandshake(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteOrganizationalUnitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteOrganizationalUnit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterDelegatedAdministratorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterDelegatedAdministrator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCreateAccountStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCreateAccountStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEffectivePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEffectivePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeHandshakeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeHandshake(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOrganizationalUnitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOrganizationalUnit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableAWSServiceAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableAWSServiceAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisablePolicyTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisablePolicyType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableAllFeaturesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableAllFeatures(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableAWSServiceAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableAWSServiceAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnablePolicyTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnablePolicyType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInviteAccountToOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InviteAccountToOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpLeaveOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.LeaveOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccountsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccounts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccountsForParentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccountsForParent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAWSServiceAccessForOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAWSServiceAccessForOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListChildrenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListChildren(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCreateAccountStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCreateAccountStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDelegatedAdministratorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDelegatedAdministrators(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDelegatedServicesForAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDelegatedServicesForAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListHandshakesForAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListHandshakesForAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListHandshakesForOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListHandshakesForOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOrganizationalUnitsForParentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOrganizationalUnitsForParent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListParentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListParents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPoliciesForTargetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPoliciesForTarget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRootsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRoots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTargetsForPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTargetsForPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMoveAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MoveAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterDelegatedAdministratorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterDelegatedAdministrator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveAccountFromOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveAccountFromOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateOrganizationalUnitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateOrganizationalUnit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/osis/generated.json b/service/osis/generated.json index 37a82b5898d..7f2d6178839 100644 --- a/service/osis/generated.json +++ b/service/osis/generated.json @@ -35,6 +35,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/osis/sra_operation_order_test.go b/service/osis/sra_operation_order_test.go new file mode 100644 index 00000000000..6da1e0c6377 --- /dev/null +++ b/service/osis/sra_operation_order_test.go @@ -0,0 +1,511 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package osis + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreatePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPipelineBlueprintSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPipelineBlueprint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPipelineChangeProgressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPipelineChangeProgress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPipelineBlueprintsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPipelineBlueprints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPipelinesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPipelines(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartPipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartPipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopPipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopPipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpValidatePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ValidatePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/outposts/generated.json b/service/outposts/generated.json index 974fbf37bcc..449f2127a74 100644 --- a/service/outposts/generated.json +++ b/service/outposts/generated.json @@ -54,6 +54,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/outposts/sra_operation_order_test.go b/service/outposts/sra_operation_order_test.go new file mode 100644 index 00000000000..4aad25c8759 --- /dev/null +++ b/service/outposts/sra_operation_order_test.go @@ -0,0 +1,1176 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package outposts + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCancelCapacityTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelCapacityTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelOrderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelOrder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateOrderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateOrder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateOutpostSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateOutpost(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSiteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSite(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteOutpostSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteOutpost(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSiteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSite(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCapacityTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCapacityTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCatalogItemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCatalogItem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOrderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOrder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOutpostSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOutpost(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOutpostInstanceTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOutpostInstanceTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOutpostSupportedInstanceTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOutpostSupportedInstanceTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSiteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSite(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSiteAddressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSiteAddress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssetInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssetInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBlockingInstancesForCapacityTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBlockingInstancesForCapacityTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCapacityTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCapacityTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCatalogItemsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCatalogItems(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOrdersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOrders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOutpostsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOutposts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSitesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSites(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartCapacityTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartCapacityTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateOutpostSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateOutpost(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSiteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSite(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSiteAddressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSiteAddress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSiteRackPhysicalPropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSiteRackPhysicalProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/panorama/generated.json b/service/panorama/generated.json index e1f2d09eda8..d7d40db4770 100644 --- a/service/panorama/generated.json +++ b/service/panorama/generated.json @@ -55,6 +55,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/panorama/sra_operation_order_test.go b/service/panorama/sra_operation_order_test.go new file mode 100644 index 00000000000..b1f7ecffd01 --- /dev/null +++ b/service/panorama/sra_operation_order_test.go @@ -0,0 +1,1211 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package panorama + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateApplicationInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApplicationInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateJobForDevicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateJobForDevices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateNodeFromTemplateJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNodeFromTemplateJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePackageImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePackageImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterPackageVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterPackageVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeApplicationInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeApplicationInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeApplicationInstanceDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeApplicationInstanceDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDeviceJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDeviceJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeNodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeNode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeNodeFromTemplateJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeNodeFromTemplateJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePackageImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePackageImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePackageVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePackageVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationInstanceDependenciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplicationInstanceDependencies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationInstanceNodeInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplicationInstanceNodeInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplicationInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDevicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDevices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDevicesJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDevicesJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNodeFromTemplateJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNodeFromTemplateJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNodesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNodes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPackageImportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPackageImportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPackagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPackages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpProvisionDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ProvisionDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterPackageVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterPackageVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveApplicationInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveApplicationInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSignalApplicationInstanceNodeInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SignalApplicationInstanceNodeInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDeviceMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDeviceMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/partnercentralselling/generated.json b/service/partnercentralselling/generated.json index 46afdd47c90..48c5dc3be84 100644 --- a/service/partnercentralselling/generated.json +++ b/service/partnercentralselling/generated.json @@ -59,6 +59,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/partnercentralselling/sra_operation_order_test.go b/service/partnercentralselling/sra_operation_order_test.go new file mode 100644 index 00000000000..73d30284049 --- /dev/null +++ b/service/partnercentralselling/sra_operation_order_test.go @@ -0,0 +1,1351 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package partnercentralselling + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcceptEngagementInvitationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptEngagementInvitation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssignOpportunitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssignOpportunity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateOpportunitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateOpportunity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEngagementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEngagement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEngagementInvitationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEngagementInvitation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateOpportunitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateOpportunity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateResourceSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateResourceSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateResourceSnapshotJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateResourceSnapshotJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourceSnapshotJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourceSnapshotJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateOpportunitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateOpportunity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAwsOpportunitySummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAwsOpportunitySummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEngagementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEngagement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEngagementInvitationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEngagementInvitation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOpportunitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOpportunity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourceSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourceSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourceSnapshotJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourceSnapshotJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSellingSystemSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSellingSystemSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEngagementByAcceptingInvitationTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEngagementByAcceptingInvitationTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEngagementFromOpportunityTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEngagementFromOpportunityTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEngagementInvitationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEngagementInvitations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEngagementMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEngagementMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEngagementResourceAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEngagementResourceAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEngagementsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEngagements(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOpportunitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOpportunities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceSnapshotJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceSnapshotJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceSnapshotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceSnapshots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSolutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSolutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutSellingSystemSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutSellingSystemSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRejectEngagementInvitationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RejectEngagementInvitation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartEngagementByAcceptingInvitationTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartEngagementByAcceptingInvitationTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartEngagementFromOpportunityTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartEngagementFromOpportunityTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartResourceSnapshotJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartResourceSnapshotJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopResourceSnapshotJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopResourceSnapshotJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSubmitOpportunitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SubmitOpportunity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateOpportunitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateOpportunity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/paymentcryptography/generated.json b/service/paymentcryptography/generated.json index 98f8f4a7de4..248ccfd0542 100644 --- a/service/paymentcryptography/generated.json +++ b/service/paymentcryptography/generated.json @@ -41,6 +41,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/paymentcryptography/sra_operation_order_test.go b/service/paymentcryptography/sra_operation_order_test.go new file mode 100644 index 00000000000..6c75f5f41cf --- /dev/null +++ b/service/paymentcryptography/sra_operation_order_test.go @@ -0,0 +1,721 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package paymentcryptography + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetParametersForExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetParametersForExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetParametersForImportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetParametersForImport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPublicKeyCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPublicKeyCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAliasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAliases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListKeysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListKeys(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartKeyUsageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartKeyUsage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopKeyUsageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopKeyUsage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/paymentcryptographydata/generated.json b/service/paymentcryptographydata/generated.json index 84429cb9187..bb4ca609a16 100644 --- a/service/paymentcryptographydata/generated.json +++ b/service/paymentcryptographydata/generated.json @@ -33,6 +33,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/paymentcryptographydata/sra_operation_order_test.go b/service/paymentcryptographydata/sra_operation_order_test.go new file mode 100644 index 00000000000..2f8190fd53a --- /dev/null +++ b/service/paymentcryptographydata/sra_operation_order_test.go @@ -0,0 +1,441 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package paymentcryptographydata + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpDecryptDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DecryptData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEncryptDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EncryptData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGenerateCardValidationDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GenerateCardValidationData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGenerateMacSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GenerateMac(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGenerateMacEmvPinChangeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GenerateMacEmvPinChange(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGeneratePinDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GeneratePinData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReEncryptDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReEncryptData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTranslatePinDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TranslatePinData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpVerifyAuthRequestCryptogramSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.VerifyAuthRequestCryptogram(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpVerifyCardValidationDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.VerifyCardValidationData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpVerifyMacSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.VerifyMac(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpVerifyPinDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.VerifyPinData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/pcaconnectorad/generated.json b/service/pcaconnectorad/generated.json index 70f09e860ed..fa791df5987 100644 --- a/service/pcaconnectorad/generated.json +++ b/service/pcaconnectorad/generated.json @@ -46,6 +46,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/pcaconnectorad/sra_operation_order_test.go b/service/pcaconnectorad/sra_operation_order_test.go new file mode 100644 index 00000000000..acbd527fa90 --- /dev/null +++ b/service/pcaconnectorad/sra_operation_order_test.go @@ -0,0 +1,896 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pcaconnectorad + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDirectoryRegistrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDirectoryRegistration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateServicePrincipalNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateServicePrincipalName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTemplateGroupAccessControlEntrySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTemplateGroupAccessControlEntry(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDirectoryRegistrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDirectoryRegistration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteServicePrincipalNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteServicePrincipalName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTemplateGroupAccessControlEntrySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTemplateGroupAccessControlEntry(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDirectoryRegistrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDirectoryRegistration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServicePrincipalNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServicePrincipalName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTemplateGroupAccessControlEntrySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTemplateGroupAccessControlEntry(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConnectorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConnectors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDirectoryRegistrationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDirectoryRegistrations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServicePrincipalNamesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServicePrincipalNames(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTemplateGroupAccessControlEntriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTemplateGroupAccessControlEntries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTemplateGroupAccessControlEntrySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTemplateGroupAccessControlEntry(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/pcaconnectorscep/generated.json b/service/pcaconnectorscep/generated.json index 1053e4657aa..f39e3bfb6f6 100644 --- a/service/pcaconnectorscep/generated.json +++ b/service/pcaconnectorscep/generated.json @@ -33,6 +33,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/pcaconnectorscep/sra_operation_order_test.go b/service/pcaconnectorscep/sra_operation_order_test.go new file mode 100644 index 00000000000..810d8282cd6 --- /dev/null +++ b/service/pcaconnectorscep/sra_operation_order_test.go @@ -0,0 +1,441 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pcaconnectorscep + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateChallengeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateChallenge(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteChallengeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteChallenge(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetChallengeMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetChallengeMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetChallengePasswordSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetChallengePassword(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListChallengeMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListChallengeMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConnectorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConnectors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/pcs/generated.json b/service/pcs/generated.json index cfc397f95b7..289dd80801f 100644 --- a/service/pcs/generated.json +++ b/service/pcs/generated.json @@ -39,6 +39,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/pcs/sra_operation_order_test.go b/service/pcs/sra_operation_order_test.go new file mode 100644 index 00000000000..518d01ae398 --- /dev/null +++ b/service/pcs/sra_operation_order_test.go @@ -0,0 +1,651 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pcs + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateComputeNodeGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateComputeNodeGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteComputeNodeGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteComputeNodeGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetComputeNodeGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetComputeNodeGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListComputeNodeGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListComputeNodeGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListQueuesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListQueues(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterComputeNodeGroupInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterComputeNodeGroupInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateComputeNodeGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateComputeNodeGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/personalize/generated.json b/service/personalize/generated.json index 625c53032c4..1302391e866 100644 --- a/service/personalize/generated.json +++ b/service/personalize/generated.json @@ -92,6 +92,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/personalize/sra_operation_order_test.go b/service/personalize/sra_operation_order_test.go new file mode 100644 index 00000000000..78db07a82ad --- /dev/null +++ b/service/personalize/sra_operation_order_test.go @@ -0,0 +1,2506 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package personalize + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateBatchInferenceJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBatchInferenceJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBatchSegmentJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBatchSegmentJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCampaignSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCampaign(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataDeletionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataDeletionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDatasetExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDatasetExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDatasetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDatasetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDatasetImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDatasetImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEventTrackerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEventTracker(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMetricAttributionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMetricAttribution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRecommenderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRecommender(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSchemaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSchema(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSolutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSolution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSolutionVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSolutionVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCampaignSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCampaign(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDatasetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDatasetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEventTrackerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEventTracker(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMetricAttributionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMetricAttribution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRecommenderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRecommender(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSchemaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSchema(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSolutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSolution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAlgorithmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAlgorithm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBatchInferenceJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBatchInferenceJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBatchSegmentJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBatchSegmentJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCampaignSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCampaign(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDataDeletionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDataDeletionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDatasetExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDatasetExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDatasetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDatasetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDatasetImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDatasetImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventTrackerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEventTracker(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFeatureTransformationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFeatureTransformation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMetricAttributionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMetricAttribution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRecipeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRecipe(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRecommenderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRecommender(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSchemaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSchema(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSolutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSolution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSolutionVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSolutionVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSolutionMetricsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSolutionMetrics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBatchInferenceJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBatchInferenceJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBatchSegmentJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBatchSegmentJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCampaignsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCampaigns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataDeletionJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataDeletionJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDatasetExportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDatasetExportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDatasetGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDatasetGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDatasetImportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDatasetImportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDatasetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDatasets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEventTrackersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEventTrackers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFiltersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFilters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMetricAttributionMetricsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMetricAttributionMetrics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMetricAttributionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMetricAttributions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRecipesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRecipes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRecommendersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRecommenders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSchemasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSchemas(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSolutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSolutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSolutionVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSolutionVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartRecommenderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartRecommender(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopRecommenderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopRecommender(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopSolutionVersionCreationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopSolutionVersionCreation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCampaignSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCampaign(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMetricAttributionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMetricAttribution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRecommenderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRecommender(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSolutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSolution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/personalizeevents/generated.json b/service/personalizeevents/generated.json index 75818d0f9eb..10d7ce1b0f6 100644 --- a/service/personalizeevents/generated.json +++ b/service/personalizeevents/generated.json @@ -26,6 +26,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/errors.go", "types/types.go", "validators.go" diff --git a/service/personalizeevents/sra_operation_order_test.go b/service/personalizeevents/sra_operation_order_test.go new file mode 100644 index 00000000000..810df2ff1c9 --- /dev/null +++ b/service/personalizeevents/sra_operation_order_test.go @@ -0,0 +1,196 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package personalizeevents + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpPutActionInteractionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutActionInteractions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutItemsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutItems(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutUsersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutUsers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/personalizeruntime/generated.json b/service/personalizeruntime/generated.json index ae3d1bf75fa..0bdddb5dd73 100644 --- a/service/personalizeruntime/generated.json +++ b/service/personalizeruntime/generated.json @@ -24,6 +24,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/errors.go", "types/types.go", "validators.go" diff --git a/service/personalizeruntime/sra_operation_order_test.go b/service/personalizeruntime/sra_operation_order_test.go new file mode 100644 index 00000000000..e56e7b590b1 --- /dev/null +++ b/service/personalizeruntime/sra_operation_order_test.go @@ -0,0 +1,126 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package personalizeruntime + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpGetActionRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetActionRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPersonalizedRankingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPersonalizedRanking(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/pi/generated.json b/service/pi/generated.json index 8b016016173..0b972ca0b71 100644 --- a/service/pi/generated.json +++ b/service/pi/generated.json @@ -34,6 +34,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/pi/sra_operation_order_test.go b/service/pi/sra_operation_order_test.go new file mode 100644 index 00000000000..f0f571a34e2 --- /dev/null +++ b/service/pi/sra_operation_order_test.go @@ -0,0 +1,476 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pi + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreatePerformanceAnalysisReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePerformanceAnalysisReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePerformanceAnalysisReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePerformanceAnalysisReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDimensionKeysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDimensionKeys(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDimensionKeyDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDimensionKeyDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPerformanceAnalysisReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPerformanceAnalysisReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourceMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourceMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourceMetricsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourceMetrics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAvailableResourceDimensionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAvailableResourceDimensions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAvailableResourceMetricsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAvailableResourceMetrics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPerformanceAnalysisReportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPerformanceAnalysisReports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/pinpoint/generated.json b/service/pinpoint/generated.json index 85372c8bc95..3081687ec76 100644 --- a/service/pinpoint/generated.json +++ b/service/pinpoint/generated.json @@ -143,6 +143,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/pinpoint/sra_operation_order_test.go b/service/pinpoint/sra_operation_order_test.go new file mode 100644 index 00000000000..1da5661954b --- /dev/null +++ b/service/pinpoint/sra_operation_order_test.go @@ -0,0 +1,4291 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pinpoint + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCampaignSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCampaign(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEmailTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEmailTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInAppTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInAppTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateJourneySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateJourney(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePushTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePushTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRecommenderConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRecommenderConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSegmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSegment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSmsTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSmsTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVoiceTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVoiceTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAdmChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAdmChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApnsChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApnsChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApnsSandboxChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApnsSandboxChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApnsVoipChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApnsVoipChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApnsVoipSandboxChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApnsVoipSandboxChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBaiduChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBaiduChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCampaignSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCampaign(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEmailChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEmailChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEmailTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEmailTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEventStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEventStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGcmChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGcmChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInAppTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInAppTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteJourneySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteJourney(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePushTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePushTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRecommenderConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRecommenderConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSegmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSegment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSmsChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSmsChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSmsTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSmsTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUserEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVoiceChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVoiceChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVoiceTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVoiceTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAdmChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAdmChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApnsChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApnsChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApnsSandboxChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApnsSandboxChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApnsVoipChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApnsVoipChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApnsVoipSandboxChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApnsVoipSandboxChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApplicationDateRangeKpiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApplicationDateRangeKpi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApplicationSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApplicationSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAppsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBaiduChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBaiduChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCampaignSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCampaign(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCampaignActivitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCampaignActivities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCampaignDateRangeKpiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCampaignDateRangeKpi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCampaignsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCampaigns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCampaignVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCampaignVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCampaignVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCampaignVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetChannelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetChannels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEmailChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEmailChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEmailTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEmailTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEventStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEventStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetExportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetExportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGcmChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGcmChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetImportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetImportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInAppMessagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInAppMessages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInAppTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInAppTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetJourneySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetJourney(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetJourneyDateRangeKpiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetJourneyDateRangeKpi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetJourneyExecutionActivityMetricsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetJourneyExecutionActivityMetrics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetJourneyExecutionMetricsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetJourneyExecutionMetrics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetJourneyRunExecutionActivityMetricsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetJourneyRunExecutionActivityMetrics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetJourneyRunExecutionMetricsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetJourneyRunExecutionMetrics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetJourneyRunsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetJourneyRuns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPushTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPushTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRecommenderConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRecommenderConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRecommenderConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRecommenderConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSegmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSegment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSegmentExportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSegmentExportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSegmentImportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSegmentImportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSegmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSegments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSegmentVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSegmentVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSegmentVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSegmentVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSmsChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSmsChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSmsTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSmsTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUserEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUserEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVoiceChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVoiceChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVoiceTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVoiceTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJourneysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJourneys(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTemplateVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTemplateVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPhoneNumberValidateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PhoneNumberValidate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutEventStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutEventStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendMessagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendMessages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendOTPMessageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendOTPMessage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendUsersMessagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendUsersMessages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAdmChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAdmChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApnsChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApnsChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApnsSandboxChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApnsSandboxChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApnsVoipChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApnsVoipChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApnsVoipSandboxChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApnsVoipSandboxChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApplicationSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApplicationSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBaiduChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBaiduChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCampaignSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCampaign(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEmailChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEmailChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEmailTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEmailTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEndpointsBatchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEndpointsBatch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGcmChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGcmChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateInAppTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateInAppTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateJourneySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateJourney(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateJourneyStateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateJourneyState(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePushTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePushTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRecommenderConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRecommenderConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSegmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSegment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSmsChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSmsChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSmsTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSmsTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTemplateActiveVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTemplateActiveVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVoiceChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVoiceChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVoiceTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVoiceTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpVerifyOTPMessageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.VerifyOTPMessage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/pinpointemail/generated.json b/service/pinpointemail/generated.json index 8c70e5d092d..f15e8b0dc5e 100644 --- a/service/pinpointemail/generated.json +++ b/service/pinpointemail/generated.json @@ -63,6 +63,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/pinpointemail/sra_operation_order_test.go b/service/pinpointemail/sra_operation_order_test.go new file mode 100644 index 00000000000..024f0dabd06 --- /dev/null +++ b/service/pinpointemail/sra_operation_order_test.go @@ -0,0 +1,1491 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pinpointemail + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateConfigurationSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConfigurationSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConfigurationSetEventDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConfigurationSetEventDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDedicatedIpPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDedicatedIpPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDeliverabilityTestReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDeliverabilityTestReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEmailIdentitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEmailIdentity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConfigurationSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConfigurationSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConfigurationSetEventDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConfigurationSetEventDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDedicatedIpPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDedicatedIpPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEmailIdentitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEmailIdentity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBlacklistReportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBlacklistReports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConfigurationSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConfigurationSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConfigurationSetEventDestinationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConfigurationSetEventDestinations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDedicatedIpSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDedicatedIp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDedicatedIpsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDedicatedIps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeliverabilityDashboardOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeliverabilityDashboardOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeliverabilityTestReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeliverabilityTestReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDomainDeliverabilityCampaignSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDomainDeliverabilityCampaign(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDomainStatisticsReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDomainStatisticsReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEmailIdentitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEmailIdentity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConfigurationSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConfigurationSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDedicatedIpPoolsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDedicatedIpPools(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDeliverabilityTestReportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDeliverabilityTestReports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDomainDeliverabilityCampaignsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDomainDeliverabilityCampaigns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEmailIdentitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEmailIdentities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAccountDedicatedIpWarmupAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAccountDedicatedIpWarmupAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAccountSendingAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAccountSendingAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutConfigurationSetDeliveryOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutConfigurationSetDeliveryOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutConfigurationSetReputationOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutConfigurationSetReputationOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutConfigurationSetSendingOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutConfigurationSetSendingOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutConfigurationSetTrackingOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutConfigurationSetTrackingOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutDedicatedIpInPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutDedicatedIpInPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutDedicatedIpWarmupAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutDedicatedIpWarmupAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutDeliverabilityDashboardOptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutDeliverabilityDashboardOption(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutEmailIdentityDkimAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutEmailIdentityDkimAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutEmailIdentityFeedbackAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutEmailIdentityFeedbackAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutEmailIdentityMailFromAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutEmailIdentityMailFromAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendEmailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendEmail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConfigurationSetEventDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConfigurationSetEventDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/pinpointsmsvoice/generated.json b/service/pinpointsmsvoice/generated.json index 7982884e01b..8b4000a1b89 100644 --- a/service/pinpointsmsvoice/generated.json +++ b/service/pinpointsmsvoice/generated.json @@ -29,6 +29,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/pinpointsmsvoice/sra_operation_order_test.go b/service/pinpointsmsvoice/sra_operation_order_test.go new file mode 100644 index 00000000000..47f945a8f1f --- /dev/null +++ b/service/pinpointsmsvoice/sra_operation_order_test.go @@ -0,0 +1,301 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pinpointsmsvoice + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateConfigurationSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConfigurationSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConfigurationSetEventDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConfigurationSetEventDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConfigurationSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConfigurationSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConfigurationSetEventDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConfigurationSetEventDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConfigurationSetEventDestinationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConfigurationSetEventDestinations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConfigurationSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConfigurationSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendVoiceMessageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendVoiceMessage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConfigurationSetEventDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConfigurationSetEventDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/pinpointsmsvoicev2/generated.json b/service/pinpointsmsvoicev2/generated.json index ef90684ad94..130b85e58e7 100644 --- a/service/pinpointsmsvoicev2/generated.json +++ b/service/pinpointsmsvoicev2/generated.json @@ -111,6 +111,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/pinpointsmsvoicev2/sra_operation_order_test.go b/service/pinpointsmsvoicev2/sra_operation_order_test.go new file mode 100644 index 00000000000..26f6625115a --- /dev/null +++ b/service/pinpointsmsvoicev2/sra_operation_order_test.go @@ -0,0 +1,3171 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pinpointsmsvoicev2 + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateOriginationIdentitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateOriginationIdentity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateProtectConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateProtectConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConfigurationSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConfigurationSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEventDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEventDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateOptOutListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateOptOutList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProtectConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProtectConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRegistrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRegistration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRegistrationAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRegistrationAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRegistrationAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRegistrationAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRegistrationVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRegistrationVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVerifiedDestinationNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVerifiedDestinationNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccountDefaultProtectConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccountDefaultProtectConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConfigurationSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConfigurationSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDefaultMessageTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDefaultMessageType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDefaultSenderIdSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDefaultSenderId(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEventDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEventDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteKeywordSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteKeyword(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMediaMessageSpendLimitOverrideSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMediaMessageSpendLimitOverride(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteOptedOutNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteOptedOutNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteOptOutListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteOptOutList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProtectConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProtectConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProtectConfigurationRuleSetNumberOverrideSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProtectConfigurationRuleSetNumberOverride(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRegistrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRegistration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRegistrationAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRegistrationAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRegistrationFieldValueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRegistrationFieldValue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTextMessageSpendLimitOverrideSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTextMessageSpendLimitOverride(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVerifiedDestinationNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVerifiedDestinationNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVoiceMessageSpendLimitOverrideSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVoiceMessageSpendLimitOverride(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccountAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccountAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccountLimitsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccountLimits(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConfigurationSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConfigurationSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeKeywordsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeKeywords(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOptedOutNumbersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOptedOutNumbers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOptOutListsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOptOutLists(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePhoneNumbersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePhoneNumbers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePoolsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePools(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeProtectConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeProtectConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRegistrationAttachmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRegistrationAttachments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRegistrationFieldDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRegistrationFieldDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRegistrationFieldValuesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRegistrationFieldValues(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRegistrationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRegistrations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRegistrationSectionDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRegistrationSectionDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRegistrationTypeDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRegistrationTypeDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRegistrationVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRegistrationVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSenderIdsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSenderIds(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSpendLimitsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSpendLimits(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVerifiedDestinationNumbersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVerifiedDestinationNumbers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateOriginationIdentitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateOriginationIdentity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateProtectConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateProtectConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDiscardRegistrationVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DiscardRegistrationVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetProtectConfigurationCountryRuleSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetProtectConfigurationCountryRuleSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPoolOriginationIdentitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPoolOriginationIdentities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProtectConfigurationRuleSetNumberOverridesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProtectConfigurationRuleSetNumberOverrides(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRegistrationAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRegistrationAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutKeywordSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutKeyword(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutMessageFeedbackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutMessageFeedback(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutOptedOutNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutOptedOutNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutProtectConfigurationRuleSetNumberOverrideSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutProtectConfigurationRuleSetNumberOverride(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRegistrationFieldValueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRegistrationFieldValue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReleasePhoneNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReleasePhoneNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReleaseSenderIdSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReleaseSenderId(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRequestPhoneNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RequestPhoneNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRequestSenderIdSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RequestSenderId(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendDestinationNumberVerificationCodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendDestinationNumberVerificationCode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendMediaMessageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendMediaMessage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendTextMessageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendTextMessage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendVoiceMessageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendVoiceMessage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetAccountDefaultProtectConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetAccountDefaultProtectConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetDefaultMessageFeedbackEnabledSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetDefaultMessageFeedbackEnabled(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetDefaultMessageTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetDefaultMessageType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetDefaultSenderIdSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetDefaultSenderId(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetMediaMessageSpendLimitOverrideSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetMediaMessageSpendLimitOverride(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetTextMessageSpendLimitOverrideSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetTextMessageSpendLimitOverride(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetVoiceMessageSpendLimitOverrideSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetVoiceMessageSpendLimitOverride(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSubmitRegistrationVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SubmitRegistrationVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEventDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEventDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePhoneNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePhoneNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProtectConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProtectConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProtectConfigurationCountryRuleSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProtectConfigurationCountryRuleSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSenderIdSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSenderId(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpVerifyDestinationNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.VerifyDestinationNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/pipes/generated.json b/service/pipes/generated.json index d4c26a7ce11..cab97655b9a 100644 --- a/service/pipes/generated.json +++ b/service/pipes/generated.json @@ -31,6 +31,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/pipes/sra_operation_order_test.go b/service/pipes/sra_operation_order_test.go new file mode 100644 index 00000000000..4fedf0014a6 --- /dev/null +++ b/service/pipes/sra_operation_order_test.go @@ -0,0 +1,371 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pipes + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreatePipeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePipe(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePipeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePipe(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePipeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePipe(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPipesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPipes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartPipeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartPipe(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopPipeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopPipe(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePipeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePipe(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/polly/generated.json b/service/polly/generated.json index abcbc0ea525..fb8c0d2044c 100644 --- a/service/polly/generated.json +++ b/service/polly/generated.json @@ -32,6 +32,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/polly/sra_operation_order_test.go b/service/polly/sra_operation_order_test.go new file mode 100644 index 00000000000..a81e29aa1ef --- /dev/null +++ b/service/polly/sra_operation_order_test.go @@ -0,0 +1,336 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package polly + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpDeleteLexiconSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLexicon(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVoicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVoices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLexiconSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLexicon(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSpeechSynthesisTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSpeechSynthesisTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLexiconsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLexicons(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSpeechSynthesisTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSpeechSynthesisTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutLexiconSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutLexicon(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartSpeechSynthesisTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartSpeechSynthesisTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSynthesizeSpeechSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SynthesizeSpeech(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/pricing/generated.json b/service/pricing/generated.json index c91c84837ff..f615016ec9a 100644 --- a/service/pricing/generated.json +++ b/service/pricing/generated.json @@ -26,6 +26,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/pricing/sra_operation_order_test.go b/service/pricing/sra_operation_order_test.go new file mode 100644 index 00000000000..556810a293b --- /dev/null +++ b/service/pricing/sra_operation_order_test.go @@ -0,0 +1,196 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package pricing + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpDescribeServicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeServices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAttributeValuesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAttributeValues(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPriceListFileUrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPriceListFileUrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetProductsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetProducts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPriceListsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPriceLists(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/privatenetworks/generated.json b/service/privatenetworks/generated.json index c25b643a248..008e5a8ae8d 100644 --- a/service/privatenetworks/generated.json +++ b/service/privatenetworks/generated.json @@ -47,6 +47,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/privatenetworks/sra_operation_order_test.go b/service/privatenetworks/sra_operation_order_test.go new file mode 100644 index 00000000000..cb28150342c --- /dev/null +++ b/service/privatenetworks/sra_operation_order_test.go @@ -0,0 +1,931 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package privatenetworks + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcknowledgeOrderReceiptSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcknowledgeOrderReceipt(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpActivateDeviceIdentifierSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ActivateDeviceIdentifier(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpActivateNetworkSiteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ActivateNetworkSite(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpConfigureAccessPointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ConfigureAccessPoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateNetworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNetwork(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateNetworkSiteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNetworkSite(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeactivateDeviceIdentifierSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeactivateDeviceIdentifier(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNetworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNetwork(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNetworkSiteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNetworkSite(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeviceIdentifierSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeviceIdentifier(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetNetworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetNetwork(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetNetworkResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetNetworkResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetNetworkSiteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetNetworkSite(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOrderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOrder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDeviceIdentifiersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDeviceIdentifiers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNetworkResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNetworkResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNetworksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNetworks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNetworkSitesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNetworkSites(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOrdersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOrders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Ping(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartNetworkResourceUpdateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartNetworkResourceUpdate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateNetworkSiteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateNetworkSite(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateNetworkSitePlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateNetworkSitePlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/proton/generated.json b/service/proton/generated.json index a54c70cfb9e..371dbce5f52 100644 --- a/service/proton/generated.json +++ b/service/proton/generated.json @@ -108,6 +108,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/proton/sra_operation_order_test.go b/service/proton/sra_operation_order_test.go new file mode 100644 index 00000000000..76e50cc3a9f --- /dev/null +++ b/service/proton/sra_operation_order_test.go @@ -0,0 +1,3066 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package proton + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcceptEnvironmentAccountConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptEnvironmentAccountConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelComponentDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelComponentDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelEnvironmentDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelEnvironmentDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelServiceInstanceDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelServiceInstanceDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelServicePipelineDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelServicePipelineDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEnvironmentAccountConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEnvironmentAccountConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEnvironmentTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEnvironmentTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEnvironmentTemplateVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEnvironmentTemplateVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRepositorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRepository(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateServiceInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateServiceInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateServiceSyncConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateServiceSyncConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateServiceTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateServiceTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateServiceTemplateVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateServiceTemplateVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTemplateSyncConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTemplateSyncConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEnvironmentAccountConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEnvironmentAccountConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEnvironmentTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEnvironmentTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEnvironmentTemplateVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEnvironmentTemplateVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRepositorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRepository(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteServiceSyncConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteServiceSyncConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteServiceTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteServiceTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteServiceTemplateVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteServiceTemplateVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTemplateSyncConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTemplateSyncConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccountSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccountSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEnvironmentAccountConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEnvironmentAccountConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEnvironmentTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEnvironmentTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEnvironmentTemplateVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEnvironmentTemplateVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRepositorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRepository(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRepositorySyncStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRepositorySyncStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourcesSummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourcesSummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServiceInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceInstanceSyncStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServiceInstanceSyncStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceSyncBlockerSummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServiceSyncBlockerSummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceSyncConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServiceSyncConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServiceTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceTemplateVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServiceTemplateVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTemplateSyncConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTemplateSyncConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTemplateSyncStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTemplateSyncStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListComponentOutputsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListComponentOutputs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListComponentProvisionedResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListComponentProvisionedResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListComponentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListComponents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDeploymentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDeployments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEnvironmentAccountConnectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEnvironmentAccountConnections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEnvironmentOutputsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEnvironmentOutputs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEnvironmentProvisionedResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEnvironmentProvisionedResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEnvironmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEnvironments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEnvironmentTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEnvironmentTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEnvironmentTemplateVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEnvironmentTemplateVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRepositoriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRepositories(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRepositorySyncDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRepositorySyncDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServiceInstanceOutputsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServiceInstanceOutputs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServiceInstanceProvisionedResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServiceInstanceProvisionedResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServiceInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServiceInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServicePipelineOutputsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServicePipelineOutputs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServicePipelineProvisionedResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServicePipelineProvisionedResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServiceTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServiceTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServiceTemplateVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServiceTemplateVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNotifyResourceDeploymentStatusChangeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NotifyResourceDeploymentStatusChange(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRejectEnvironmentAccountConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RejectEnvironmentAccountConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAccountSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAccountSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEnvironmentAccountConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEnvironmentAccountConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEnvironmentTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEnvironmentTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEnvironmentTemplateVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEnvironmentTemplateVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateServiceInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateServiceInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateServicePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateServicePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateServiceSyncBlockerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateServiceSyncBlocker(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateServiceSyncConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateServiceSyncConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateServiceTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateServiceTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateServiceTemplateVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateServiceTemplateVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTemplateSyncConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTemplateSyncConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/qapps/generated.json b/service/qapps/generated.json index f6a31e8d97b..219b83c8c2b 100644 --- a/service/qapps/generated.json +++ b/service/qapps/generated.json @@ -60,6 +60,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/qapps/sra_operation_order_test.go b/service/qapps/sra_operation_order_test.go new file mode 100644 index 00000000000..4323cfd3b52 --- /dev/null +++ b/service/qapps/sra_operation_order_test.go @@ -0,0 +1,1246 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qapps + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateLibraryItemReviewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateLibraryItemReview(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateQAppWithUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateQAppWithUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchCreateCategorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchCreateCategory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeleteCategorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteCategory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchUpdateCategorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchUpdateCategory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLibraryItemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLibraryItem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePresignedUrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePresignedUrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateQAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateQApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLibraryItemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLibraryItem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteQAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteQApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeQAppPermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeQAppPermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateLibraryItemReviewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateLibraryItemReview(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateQAppFromUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateQAppFromUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportQAppSessionDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportQAppSessionData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLibraryItemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLibraryItem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQAppSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQAppSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQAppSessionMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQAppSessionMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportDocumentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportDocument(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCategoriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCategories(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLibraryItemsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLibraryItems(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListQAppsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListQApps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListQAppSessionDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListQAppSessionData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPredictQAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PredictQApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartQAppSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartQAppSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopQAppSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopQAppSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLibraryItemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLibraryItem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLibraryItemMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLibraryItemMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateQAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateQApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateQAppPermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateQAppPermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateQAppSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateQAppSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateQAppSessionMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateQAppSessionMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/qbusiness/generated.json b/service/qbusiness/generated.json index 662e685acf7..24e92025bfe 100644 --- a/service/qbusiness/generated.json +++ b/service/qbusiness/generated.json @@ -102,6 +102,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/qbusiness/sra_operation_order_test.go b/service/qbusiness/sra_operation_order_test.go new file mode 100644 index 00000000000..bd1a840cfa9 --- /dev/null +++ b/service/qbusiness/sra_operation_order_test.go @@ -0,0 +1,2646 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qbusiness + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociatePermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociatePermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeleteDocumentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteDocument(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchPutDocumentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchPutDocument(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpChatSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Chat(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpChatSyncSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ChatSync(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataAccessorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataAccessor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIndexSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIndex(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePluginSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePlugin(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRetrieverSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRetriever(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWebExperienceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWebExperience(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteChatControlsConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteChatControlsConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConversationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConversation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataAccessorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataAccessor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIndexSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIndex(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePluginSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePlugin(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRetrieverSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRetriever(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWebExperienceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWebExperience(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociatePermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociatePermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetChatControlsConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetChatControlsConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataAccessorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataAccessor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIndexSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIndex(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMediaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMedia(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPluginSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPlugin(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRetrieverSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRetriever(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWebExperienceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWebExperience(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAttachmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAttachments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConversationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConversations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataAccessorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataAccessors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataSourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataSources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataSourceSyncJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataSourceSyncJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDocumentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDocuments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIndicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIndices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMessagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMessages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPluginActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPluginActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPluginsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPlugins(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPluginTypeActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPluginTypeActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPluginTypeMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPluginTypeMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRetrieversSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRetrievers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSubscriptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSubscriptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWebExperiencesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWebExperiences(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutFeedbackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutFeedback(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchRelevantContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchRelevantContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDataSourceSyncJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDataSourceSyncJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopDataSourceSyncJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopDataSourceSyncJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateChatControlsConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateChatControlsConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDataAccessorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataAccessor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIndexSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIndex(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePluginSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePlugin(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRetrieverSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRetriever(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWebExperienceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWebExperience(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/qconnect/generated.json b/service/qconnect/generated.json index 5f52dfde2e8..ade74504876 100644 --- a/service/qconnect/generated.json +++ b/service/qconnect/generated.json @@ -112,6 +112,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/qconnect/sra_operation_order_test.go b/service/qconnect/sra_operation_order_test.go new file mode 100644 index 00000000000..9e4dadf9ce5 --- /dev/null +++ b/service/qconnect/sra_operation_order_test.go @@ -0,0 +1,3206 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qconnect + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpActivateMessageTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ActivateMessageTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAIAgentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAIAgent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAIAgentVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAIAgentVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAIGuardrailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAIGuardrail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAIGuardrailVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAIGuardrailVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAIPromptSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAIPrompt(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAIPromptVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAIPromptVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAssistantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAssistant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAssistantAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAssistantAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateContentAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateContentAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateKnowledgeBaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateKnowledgeBase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMessageTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMessageTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMessageTemplateAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMessageTemplateAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMessageTemplateVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMessageTemplateVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateQuickResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateQuickResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeactivateMessageTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeactivateMessageTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAIAgentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAIAgent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAIAgentVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAIAgentVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAIGuardrailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAIGuardrail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAIGuardrailVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAIGuardrailVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAIPromptSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAIPrompt(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAIPromptVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAIPromptVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAssistantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAssistant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAssistantAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAssistantAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteContentAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteContentAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteKnowledgeBaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteKnowledgeBase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMessageTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMessageTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMessageTemplateAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMessageTemplateAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteQuickResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteQuickResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAIAgentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAIAgent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAIGuardrailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAIGuardrail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAIPromptSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAIPrompt(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAssistantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAssistant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAssistantAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAssistantAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetContentAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetContentAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetContentSummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetContentSummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetKnowledgeBaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetKnowledgeBase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMessageTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMessageTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetNextMessageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetNextMessage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQuickResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQuickResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAIAgentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAIAgents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAIAgentVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAIAgentVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAIGuardrailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAIGuardrails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAIGuardrailVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAIGuardrailVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAIPromptsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAIPrompts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAIPromptVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAIPromptVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssistantAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssistantAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssistantsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssistants(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListContentAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListContentAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListContentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListContents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListImportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListImportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListKnowledgeBasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListKnowledgeBases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMessagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMessages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMessageTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMessageTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMessageTemplateVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMessageTemplateVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListQuickResponsesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListQuickResponses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNotifyRecommendationsReceivedSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NotifyRecommendationsReceived(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutFeedbackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutFeedback(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpQueryAssistantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.QueryAssistant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveAssistantAIAgentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveAssistantAIAgent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveKnowledgeBaseTemplateUriSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveKnowledgeBaseTemplateUri(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRenderMessageTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RenderMessageTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchMessageTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchMessageTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchQuickResponsesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchQuickResponses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchSessionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchSessions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendMessageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendMessage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartContentUploadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartContentUpload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAIAgentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAIAgent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAIGuardrailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAIGuardrail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAIPromptSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAIPrompt(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAssistantAIAgentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAssistantAIAgent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateKnowledgeBaseTemplateUriSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateKnowledgeBaseTemplateUri(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMessageTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMessageTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMessageTemplateMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMessageTemplateMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateQuickResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateQuickResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSessionDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSessionData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/qldb/generated.json b/service/qldb/generated.json index 1e4ac4ec0f5..bf1de28d6fa 100644 --- a/service/qldb/generated.json +++ b/service/qldb/generated.json @@ -41,6 +41,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/qldb/sra_operation_order_test.go b/service/qldb/sra_operation_order_test.go new file mode 100644 index 00000000000..57bb2dbfcc7 --- /dev/null +++ b/service/qldb/sra_operation_order_test.go @@ -0,0 +1,721 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qldb + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCancelJournalKinesisStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelJournalKinesisStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLedgerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLedger(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLedgerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLedger(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeJournalKinesisStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeJournalKinesisStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeJournalS3ExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeJournalS3Export(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLedgerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLedger(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportJournalToS3SRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportJournalToS3(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBlockSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBlock(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDigestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDigest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRevisionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRevision(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJournalKinesisStreamsForLedgerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJournalKinesisStreamsForLedger(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJournalS3ExportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJournalS3Exports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJournalS3ExportsForLedgerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJournalS3ExportsForLedger(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLedgersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLedgers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStreamJournalToKinesisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StreamJournalToKinesis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLedgerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLedger(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLedgerPermissionsModeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLedgerPermissionsMode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/qldbsession/generated.json b/service/qldbsession/generated.json index 618598e1dc9..20bc41d2e91 100644 --- a/service/qldbsession/generated.json +++ b/service/qldbsession/generated.json @@ -22,6 +22,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/errors.go", "types/types.go", "validators.go" diff --git a/service/qldbsession/sra_operation_order_test.go b/service/qldbsession/sra_operation_order_test.go new file mode 100644 index 00000000000..d58fe1e0366 --- /dev/null +++ b/service/qldbsession/sra_operation_order_test.go @@ -0,0 +1,56 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package qldbsession + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpSendCommandSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendCommand(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/quicksight/generated.json b/service/quicksight/generated.json index e591baf464f..c7d0e5a3e1c 100644 --- a/service/quicksight/generated.json +++ b/service/quicksight/generated.json @@ -230,6 +230,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/quicksight/sra_operation_order_test.go b/service/quicksight/sra_operation_order_test.go new file mode 100644 index 00000000000..50ef0660735 --- /dev/null +++ b/service/quicksight/sra_operation_order_test.go @@ -0,0 +1,7336 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package quicksight + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchCreateTopicReviewedAnswerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchCreateTopicReviewedAnswer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeleteTopicReviewedAnswerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteTopicReviewedAnswer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelIngestionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelIngestion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAccountCustomizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAccountCustomization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAccountSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAccountSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAnalysisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAnalysis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBrandSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBrand(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCustomPermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCustomPermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDashboardSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDashboard(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFolderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFolder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFolderMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFolderMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGroupMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGroupMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIAMPolicyAssignmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIAMPolicyAssignment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIngestionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIngestion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRefreshScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRefreshSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRoleMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRoleMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTemplateAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTemplateAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateThemeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTheme(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateThemeAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateThemeAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTopicSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTopic(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTopicRefreshScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTopicRefreshSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVPCConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVPCConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccountCustomizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccountCustomization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccountSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccountSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAnalysisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAnalysis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBrandSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBrand(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBrandAssignmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBrandAssignment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCustomPermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCustomPermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDashboardSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDashboard(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataSetRefreshPropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataSetRefreshProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDefaultQBusinessApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDefaultQBusinessApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFolderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFolder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFolderMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFolderMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGroupMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGroupMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIAMPolicyAssignmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIAMPolicyAssignment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIdentityPropagationConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIdentityPropagationConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRefreshScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRefreshSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRoleCustomPermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRoleCustomPermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRoleMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRoleMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTemplateAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTemplateAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteThemeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTheme(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteThemeAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteThemeAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTopicSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTopic(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTopicRefreshScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTopicRefreshSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserByPrincipalIdSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUserByPrincipalId(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserCustomPermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUserCustomPermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVPCConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVPCConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccountCustomizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccountCustomization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccountSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccountSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccountSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccountSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAnalysisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAnalysis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAnalysisDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAnalysisDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAnalysisPermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAnalysisPermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAssetBundleExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAssetBundleExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAssetBundleImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAssetBundleImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBrandSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBrand(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBrandAssignmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBrandAssignment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBrandPublishedVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBrandPublishedVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCustomPermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCustomPermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDashboardSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDashboard(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDashboardDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDashboardDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDashboardPermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDashboardPermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDashboardSnapshotJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDashboardSnapshotJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDashboardSnapshotJobResultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDashboardSnapshotJobResult(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDashboardsQAConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDashboardsQAConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDataSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDataSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDataSetPermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDataSetPermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDataSetRefreshPropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDataSetRefreshProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDataSourcePermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDataSourcePermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDefaultQBusinessApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDefaultQBusinessApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFolderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFolder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFolderPermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFolderPermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFolderResolvedPermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFolderResolvedPermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGroupMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGroupMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIAMPolicyAssignmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIAMPolicyAssignment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIngestionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIngestion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIpRestrictionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIpRestriction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeKeyRegistrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeKeyRegistration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeQPersonalizationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeQPersonalizationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeQuickSightQSearchConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeQuickSightQSearchConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRefreshScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRefreshSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRoleCustomPermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRoleCustomPermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTemplateAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTemplateAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTemplateDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTemplateDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTemplatePermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTemplatePermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeThemeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTheme(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeThemeAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeThemeAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeThemePermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeThemePermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTopicSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTopic(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTopicPermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTopicPermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTopicRefreshSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTopicRefresh(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTopicRefreshScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTopicRefreshSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVPCConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVPCConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGenerateEmbedUrlForAnonymousUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GenerateEmbedUrlForAnonymousUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGenerateEmbedUrlForRegisteredUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GenerateEmbedUrlForRegisteredUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGenerateEmbedUrlForRegisteredUserWithIdentitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GenerateEmbedUrlForRegisteredUserWithIdentity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDashboardEmbedUrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDashboardEmbedUrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSessionEmbedUrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSessionEmbedUrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAnalysesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAnalyses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssetBundleExportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssetBundleExportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssetBundleImportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssetBundleImportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBrandsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBrands(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCustomPermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCustomPermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDashboardsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDashboards(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDashboardVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDashboardVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataSourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataSources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFolderMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFolderMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFoldersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFolders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFoldersForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFoldersForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGroupMembershipsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGroupMemberships(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIAMPolicyAssignmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIAMPolicyAssignments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIAMPolicyAssignmentsForUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIAMPolicyAssignmentsForUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIdentityPropagationConfigsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIdentityPropagationConfigs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIngestionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIngestions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNamespacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNamespaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRefreshSchedulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRefreshSchedules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRoleMembershipsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRoleMemberships(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTemplateAliasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTemplateAliases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTemplateVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTemplateVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListThemeAliasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListThemeAliases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListThemesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListThemes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListThemeVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListThemeVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTopicRefreshSchedulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTopicRefreshSchedules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTopicReviewedAnswersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTopicReviewedAnswers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTopicsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTopics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUserGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUserGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUsersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUsers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVPCConnectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVPCConnections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPredictQAResultsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PredictQAResults(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutDataSetRefreshPropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutDataSetRefreshProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreAnalysisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreAnalysis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchAnalysesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchAnalyses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchDashboardsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchDashboards(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchDataSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchDataSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchDataSourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchDataSources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchFoldersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchFolders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchTopicsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchTopics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartAssetBundleExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartAssetBundleExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartAssetBundleImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartAssetBundleImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDashboardSnapshotJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDashboardSnapshotJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDashboardSnapshotJobScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDashboardSnapshotJobSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAccountCustomizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAccountCustomization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAccountSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAccountSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAnalysisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAnalysis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAnalysisPermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAnalysisPermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApplicationWithTokenExchangeGrantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApplicationWithTokenExchangeGrant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBrandSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBrand(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBrandAssignmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBrandAssignment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBrandPublishedVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBrandPublishedVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCustomPermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCustomPermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDashboardSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDashboard(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDashboardLinksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDashboardLinks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDashboardPermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDashboardPermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDashboardPublishedVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDashboardPublishedVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDashboardsQAConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDashboardsQAConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDataSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDataSetPermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataSetPermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDataSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDataSourcePermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataSourcePermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDefaultQBusinessApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDefaultQBusinessApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFolderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFolder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFolderPermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFolderPermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIAMPolicyAssignmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIAMPolicyAssignment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIdentityPropagationConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIdentityPropagationConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIpRestrictionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIpRestriction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateKeyRegistrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateKeyRegistration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePublicSharingSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePublicSharingSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateQPersonalizationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateQPersonalizationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateQuickSightQSearchConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateQuickSightQSearchConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRefreshScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRefreshSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRoleCustomPermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRoleCustomPermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSPICECapacityConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSPICECapacityConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTemplateAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTemplateAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTemplatePermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTemplatePermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateThemeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTheme(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateThemeAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateThemeAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateThemePermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateThemePermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTopicSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTopic(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTopicPermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTopicPermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTopicRefreshScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTopicRefreshSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserCustomPermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUserCustomPermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVPCConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVPCConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/ram/generated.json b/service/ram/generated.json index 01b018d0273..7917c49744d 100644 --- a/service/ram/generated.json +++ b/service/ram/generated.json @@ -55,6 +55,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/ram/sra_operation_order_test.go b/service/ram/sra_operation_order_test.go new file mode 100644 index 00000000000..19bf99c3e6f --- /dev/null +++ b/service/ram/sra_operation_order_test.go @@ -0,0 +1,1211 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ram + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcceptResourceShareInvitationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptResourceShareInvitation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateResourceShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateResourceShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateResourceSharePermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateResourceSharePermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePermissionVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePermissionVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateResourceShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateResourceShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePermissionVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePermissionVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourceShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourceShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateResourceShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateResourceShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateResourceSharePermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateResourceSharePermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableSharingWithAwsOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableSharingWithAwsOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourcePoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourcePolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourceShareAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourceShareAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourceShareInvitationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourceShareInvitations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourceSharesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourceShares(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPendingInvitationResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPendingInvitationResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPermissionAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPermissionAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPermissionVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPermissionVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPrincipalsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPrincipals(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReplacePermissionAssociationsWorkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReplacePermissionAssociationsWork(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceSharePermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceSharePermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPromotePermissionCreatedFromPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PromotePermissionCreatedFromPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPromoteResourceShareCreatedFromPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PromoteResourceShareCreatedFromPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRejectResourceShareInvitationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RejectResourceShareInvitation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReplacePermissionAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReplacePermissionAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetDefaultPermissionVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetDefaultPermissionVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateResourceShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateResourceShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/rbin/generated.json b/service/rbin/generated.json index 1b13d6a89aa..6ccae268950 100644 --- a/service/rbin/generated.json +++ b/service/rbin/generated.json @@ -31,6 +31,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/rbin/sra_operation_order_test.go b/service/rbin/sra_operation_order_test.go new file mode 100644 index 00000000000..74122c2278e --- /dev/null +++ b/service/rbin/sra_operation_order_test.go @@ -0,0 +1,371 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rbin + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpLockRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.LockRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUnlockRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UnlockRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/rds/generated.json b/service/rds/generated.json index 171c689902a..538b44c4fb6 100644 --- a/service/rds/generated.json +++ b/service/rds/generated.json @@ -189,6 +189,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/rds/sra_operation_order_test.go b/service/rds/sra_operation_order_test.go new file mode 100644 index 00000000000..ce202af337e --- /dev/null +++ b/service/rds/sra_operation_order_test.go @@ -0,0 +1,5691 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddRoleToDBClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddRoleToDBCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddRoleToDBInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddRoleToDBInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddSourceIdentifierToSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddSourceIdentifierToSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddTagsToResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddTagsToResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpApplyPendingMaintenanceActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ApplyPendingMaintenanceAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAuthorizeDBSecurityGroupIngressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AuthorizeDBSecurityGroupIngress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBacktrackDBClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BacktrackDBCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelExportTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelExportTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCopyDBClusterParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopyDBClusterParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCopyDBClusterSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopyDBClusterSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCopyDBParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopyDBParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCopyDBSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopyDBSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCopyOptionGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopyOptionGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBlueGreenDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBlueGreenDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCustomDBEngineVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCustomDBEngineVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDBClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDBCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDBClusterEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDBClusterEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDBClusterParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDBClusterParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDBClusterSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDBClusterSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDBInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDBInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDBInstanceReadReplicaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDBInstanceReadReplica(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDBParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDBParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDBProxySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDBProxy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDBProxyEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDBProxyEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDBSecurityGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDBSecurityGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDBShardGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDBShardGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDBSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDBSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDBSubnetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDBSubnetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEventSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEventSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGlobalClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGlobalCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateOptionGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateOptionGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTenantDatabaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTenantDatabase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBlueGreenDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBlueGreenDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCustomDBEngineVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCustomDBEngineVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDBClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDBCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDBClusterAutomatedBackupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDBClusterAutomatedBackup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDBClusterEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDBClusterEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDBClusterParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDBClusterParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDBClusterSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDBClusterSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDBInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDBInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDBInstanceAutomatedBackupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDBInstanceAutomatedBackup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDBParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDBParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDBProxySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDBProxy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDBProxyEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDBProxyEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDBSecurityGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDBSecurityGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDBShardGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDBShardGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDBSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDBSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDBSubnetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDBSubnetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEventSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEventSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGlobalClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGlobalCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteOptionGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteOptionGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTenantDatabaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTenantDatabase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterDBProxyTargetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterDBProxyTargets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccountAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccountAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBlueGreenDeploymentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBlueGreenDeployments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCertificatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCertificates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBClusterAutomatedBackupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBClusterAutomatedBackups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBClusterBacktracksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBClusterBacktracks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBClusterEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBClusterEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBClusterParameterGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBClusterParameterGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBClusterParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBClusterParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBClusterSnapshotAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBClusterSnapshotAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBClusterSnapshotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBClusterSnapshots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBEngineVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBEngineVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBInstanceAutomatedBackupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBInstanceAutomatedBackups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBLogFilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBLogFiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBParameterGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBParameterGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBProxiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBProxies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBProxyEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBProxyEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBProxyTargetGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBProxyTargetGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBProxyTargetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBProxyTargets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBSecurityGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBSecurityGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBShardGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBShardGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBSnapshotAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBSnapshotAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBSnapshotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBSnapshots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBSnapshotTenantDatabasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBSnapshotTenantDatabases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDBSubnetGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDBSubnetGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEngineDefaultClusterParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEngineDefaultClusterParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEngineDefaultParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEngineDefaultParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventCategoriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEventCategories(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventSubscriptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEventSubscriptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeExportTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeExportTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGlobalClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGlobalClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIntegrationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIntegrations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOptionGroupOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOptionGroupOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOptionGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOptionGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOrderableDBInstanceOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOrderableDBInstanceOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePendingMaintenanceActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePendingMaintenanceActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReservedDBInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReservedDBInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReservedDBInstancesOfferingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReservedDBInstancesOfferings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSourceRegionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSourceRegions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTenantDatabasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTenantDatabases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeValidDBInstanceModificationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeValidDBInstanceModifications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableHttpEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableHttpEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDownloadDBLogFilePortionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DownloadDBLogFilePortion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableHttpEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableHttpEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpFailoverDBClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.FailoverDBCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpFailoverGlobalClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.FailoverGlobalCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyActivityStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyActivityStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyCertificatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyCertificates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyCurrentDBClusterCapacitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyCurrentDBClusterCapacity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyCustomDBEngineVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyCustomDBEngineVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDBClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDBCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDBClusterEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDBClusterEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDBClusterParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDBClusterParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDBClusterSnapshotAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDBClusterSnapshotAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDBInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDBInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDBParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDBParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDBProxySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDBProxy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDBProxyEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDBProxyEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDBProxyTargetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDBProxyTargetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDBRecommendationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDBRecommendation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDBShardGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDBShardGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDBSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDBSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDBSnapshotAttributeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDBSnapshotAttribute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDBSubnetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDBSubnetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyEventSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyEventSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyGlobalClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyGlobalCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyOptionGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyOptionGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyTenantDatabaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyTenantDatabase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPromoteReadReplicaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PromoteReadReplica(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPromoteReadReplicaDBClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PromoteReadReplicaDBCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPurchaseReservedDBInstancesOfferingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PurchaseReservedDBInstancesOffering(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRebootDBClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RebootDBCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRebootDBInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RebootDBInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRebootDBShardGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RebootDBShardGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterDBProxyTargetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterDBProxyTargets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveFromGlobalClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveFromGlobalCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveRoleFromDBClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveRoleFromDBCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveRoleFromDBInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveRoleFromDBInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveSourceIdentifierFromSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveSourceIdentifierFromSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveTagsFromResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveTagsFromResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetDBClusterParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetDBClusterParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetDBParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetDBParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreDBClusterFromS3SRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreDBClusterFromS3(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreDBClusterFromSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreDBClusterFromSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreDBClusterToPointInTimeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreDBClusterToPointInTime(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreDBInstanceFromDBSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreDBInstanceFromDBSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreDBInstanceFromS3SRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreDBInstanceFromS3(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreDBInstanceToPointInTimeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreDBInstanceToPointInTime(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRevokeDBSecurityGroupIngressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RevokeDBSecurityGroupIngress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartActivityStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartActivityStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDBClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDBCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDBInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDBInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDBInstanceAutomatedBackupsReplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDBInstanceAutomatedBackupsReplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartExportTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartExportTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopActivityStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopActivityStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopDBClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopDBCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopDBInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopDBInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopDBInstanceAutomatedBackupsReplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopDBInstanceAutomatedBackupsReplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSwitchoverBlueGreenDeploymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SwitchoverBlueGreenDeployment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSwitchoverGlobalClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SwitchoverGlobalCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSwitchoverReadReplicaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SwitchoverReadReplica(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/rdsdata/generated.json b/service/rdsdata/generated.json index f005fa447fa..2325532264c 100644 --- a/service/rdsdata/generated.json +++ b/service/rdsdata/generated.json @@ -27,6 +27,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/rdsdata/sra_operation_order_test.go b/service/rdsdata/sra_operation_order_test.go new file mode 100644 index 00000000000..9f9ccdf0d54 --- /dev/null +++ b/service/rdsdata/sra_operation_order_test.go @@ -0,0 +1,231 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rdsdata + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchExecuteStatementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchExecuteStatement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBeginTransactionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BeginTransaction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCommitTransactionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CommitTransaction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExecuteSqlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExecuteSql(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExecuteStatementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExecuteStatement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRollbackTransactionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RollbackTransaction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/redshift/generated.json b/service/redshift/generated.json index ecc6295de47..af9fef240f9 100644 --- a/service/redshift/generated.json +++ b/service/redshift/generated.json @@ -160,6 +160,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/redshift/sra_operation_order_test.go b/service/redshift/sra_operation_order_test.go new file mode 100644 index 00000000000..3a860ec0914 --- /dev/null +++ b/service/redshift/sra_operation_order_test.go @@ -0,0 +1,4886 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshift + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcceptReservedNodeExchangeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptReservedNodeExchange(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddPartnerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddPartner(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateDataShareConsumerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateDataShareConsumer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAuthorizeClusterSecurityGroupIngressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AuthorizeClusterSecurityGroupIngress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAuthorizeDataShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AuthorizeDataShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAuthorizeEndpointAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AuthorizeEndpointAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAuthorizeSnapshotAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AuthorizeSnapshotAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeleteClusterSnapshotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteClusterSnapshots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchModifyClusterSnapshotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchModifyClusterSnapshots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelResizeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelResize(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCopyClusterSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopyClusterSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAuthenticationProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAuthenticationProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateClusterParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateClusterParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateClusterSecurityGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateClusterSecurityGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateClusterSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateClusterSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateClusterSubnetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateClusterSubnetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCustomDomainAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCustomDomainAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEndpointAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEndpointAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEventSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEventSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateHsmClientCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateHsmClientCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateHsmConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateHsmConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRedshiftIdcApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRedshiftIdcApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateScheduledActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateScheduledAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSnapshotCopyGrantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSnapshotCopyGrant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSnapshotScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSnapshotSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUsageLimitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUsageLimit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeauthorizeDataShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeauthorizeDataShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAuthenticationProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAuthenticationProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteClusterParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteClusterParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteClusterSecurityGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteClusterSecurityGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteClusterSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteClusterSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteClusterSubnetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteClusterSubnetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCustomDomainAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCustomDomainAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEndpointAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEndpointAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEventSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEventSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteHsmClientCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteHsmClientCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteHsmConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteHsmConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePartnerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePartner(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRedshiftIdcApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRedshiftIdcApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteScheduledActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteScheduledAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSnapshotCopyGrantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSnapshotCopyGrant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSnapshotScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSnapshotSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUsageLimitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUsageLimit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccountAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccountAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAuthenticationProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAuthenticationProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClusterDbRevisionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeClusterDbRevisions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClusterParameterGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeClusterParameterGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClusterParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeClusterParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClusterSecurityGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeClusterSecurityGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClusterSnapshotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeClusterSnapshots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClusterSubnetGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeClusterSubnetGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClusterTracksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeClusterTracks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClusterVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeClusterVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCustomDomainAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCustomDomainAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDataSharesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDataShares(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDataSharesForConsumerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDataSharesForConsumer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDataSharesForProducerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDataSharesForProducer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDefaultClusterParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDefaultClusterParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEndpointAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEndpointAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEndpointAuthorizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEndpointAuthorization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventCategoriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEventCategories(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEventSubscriptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEventSubscriptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeHsmClientCertificatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeHsmClientCertificates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeHsmConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeHsmConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInboundIntegrationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInboundIntegrations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIntegrationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIntegrations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLoggingStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLoggingStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeNodeConfigurationOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeNodeConfigurationOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOrderableClusterOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOrderableClusterOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePartnersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePartners(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRedshiftIdcApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRedshiftIdcApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReservedNodeExchangeStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReservedNodeExchangeStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReservedNodeOfferingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReservedNodeOfferings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReservedNodesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReservedNodes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeResizeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeResize(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeScheduledActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeScheduledActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSnapshotCopyGrantsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSnapshotCopyGrants(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSnapshotSchedulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSnapshotSchedules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStorageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStorage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTableRestoreStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTableRestoreStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeUsageLimitsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeUsageLimits(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableLoggingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableLogging(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableSnapshotCopySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableSnapshotCopy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateDataShareConsumerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateDataShareConsumer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableLoggingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableLogging(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableSnapshotCopySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableSnapshotCopy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpFailoverPrimaryComputeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.FailoverPrimaryCompute(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetClusterCredentialsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetClusterCredentials(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetClusterCredentialsWithIAMSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetClusterCredentialsWithIAM(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReservedNodeExchangeConfigurationOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReservedNodeExchangeConfigurationOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReservedNodeExchangeOfferingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReservedNodeExchangeOfferings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyAquaConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyAquaConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyAuthenticationProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyAuthenticationProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyClusterDbRevisionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyClusterDbRevision(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyClusterIamRolesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyClusterIamRoles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyClusterMaintenanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyClusterMaintenance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyClusterParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyClusterParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyClusterSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyClusterSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyClusterSnapshotScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyClusterSnapshotSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyClusterSubnetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyClusterSubnetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyCustomDomainAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyCustomDomainAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyEndpointAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyEndpointAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyEventSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyEventSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyRedshiftIdcApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyRedshiftIdcApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyScheduledActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyScheduledAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifySnapshotCopyRetentionPeriodSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifySnapshotCopyRetentionPeriod(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifySnapshotScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifySnapshotSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyUsageLimitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyUsageLimit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPauseClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PauseCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPurchaseReservedNodeOfferingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PurchaseReservedNodeOffering(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRebootClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RebootCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRejectDataShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RejectDataShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetClusterParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetClusterParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResizeClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResizeCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreFromClusterSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreFromClusterSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreTableFromClusterSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreTableFromClusterSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResumeClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResumeCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRevokeClusterSecurityGroupIngressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RevokeClusterSecurityGroupIngress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRevokeEndpointAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RevokeEndpointAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRevokeSnapshotAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RevokeSnapshotAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRotateEncryptionKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RotateEncryptionKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePartnerStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePartnerStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/redshiftdata/generated.json b/service/redshiftdata/generated.json index 82bb138de7a..d240761958a 100644 --- a/service/redshiftdata/generated.json +++ b/service/redshiftdata/generated.json @@ -32,6 +32,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/redshiftdata/sra_operation_order_test.go b/service/redshiftdata/sra_operation_order_test.go new file mode 100644 index 00000000000..7611a41e431 --- /dev/null +++ b/service/redshiftdata/sra_operation_order_test.go @@ -0,0 +1,406 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftdata + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchExecuteStatementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchExecuteStatement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelStatementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelStatement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStatementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStatement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExecuteStatementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExecuteStatement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStatementResultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStatementResult(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStatementResultV2SRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStatementResultV2(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDatabasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDatabases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSchemasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSchemas(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStatementsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStatements(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTablesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTables(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/redshiftserverless/generated.json b/service/redshiftserverless/generated.json index 9052ec5cd7b..ef92a43b0c5 100644 --- a/service/redshiftserverless/generated.json +++ b/service/redshiftserverless/generated.json @@ -79,6 +79,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/redshiftserverless/sra_operation_order_test.go b/service/redshiftserverless/sra_operation_order_test.go new file mode 100644 index 00000000000..2943e4f2821 --- /dev/null +++ b/service/redshiftserverless/sra_operation_order_test.go @@ -0,0 +1,2051 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpConvertRecoveryPointToSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ConvertRecoveryPointToSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCustomDomainAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCustomDomainAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEndpointAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEndpointAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateScheduledActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateScheduledAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSnapshotCopyConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSnapshotCopyConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUsageLimitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUsageLimit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorkgroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorkgroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCustomDomainAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCustomDomainAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEndpointAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEndpointAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteScheduledActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteScheduledAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSnapshotCopyConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSnapshotCopyConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUsageLimitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUsageLimit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWorkgroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWorkgroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCredentialsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCredentials(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCustomDomainAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCustomDomainAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEndpointAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEndpointAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRecoveryPointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRecoveryPoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetScheduledActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetScheduledAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTableRestoreStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTableRestoreStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTrackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTrack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUsageLimitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUsageLimit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWorkgroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWorkgroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCustomDomainAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCustomDomainAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEndpointAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEndpointAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListManagedWorkgroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListManagedWorkgroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNamespacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNamespaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRecoveryPointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRecoveryPoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListScheduledActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListScheduledActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSnapshotCopyConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSnapshotCopyConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSnapshotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSnapshots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTableRestoreStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTableRestoreStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTracksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTracks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUsageLimitsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUsageLimits(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkgroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkgroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreFromRecoveryPointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreFromRecoveryPoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreFromSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreFromSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreTableFromRecoveryPointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreTableFromRecoveryPoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreTableFromSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreTableFromSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCustomDomainAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCustomDomainAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEndpointAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEndpointAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateScheduledActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateScheduledAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSnapshotCopyConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSnapshotCopyConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUsageLimitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUsageLimit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWorkgroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWorkgroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/rekognition/generated.json b/service/rekognition/generated.json index f2dc21ff58c..4e93e6bec57 100644 --- a/service/rekognition/generated.json +++ b/service/rekognition/generated.json @@ -96,6 +96,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/rekognition/sra_operation_order_test.go b/service/rekognition/sra_operation_order_test.go new file mode 100644 index 00000000000..1a416fda889 --- /dev/null +++ b/service/rekognition/sra_operation_order_test.go @@ -0,0 +1,2646 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rekognition + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateFacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateFaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCompareFacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CompareFaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCopyProjectVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopyProjectVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCollectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCollection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFaceLivenessSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFaceLivenessSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProjectVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProjectVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStreamProcessorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStreamProcessor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCollectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCollection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProjectPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProjectPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProjectVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProjectVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteStreamProcessorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteStreamProcessor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCollectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCollection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeProjectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeProjects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeProjectVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeProjectVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStreamProcessorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStreamProcessor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetectCustomLabelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetectCustomLabels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetectFacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetectFaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetectLabelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetectLabels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetectModerationLabelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetectModerationLabels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetectProtectiveEquipmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetectProtectiveEquipment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetectTextSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetectText(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateFacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateFaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDistributeDatasetEntriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DistributeDatasetEntries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCelebrityInfoSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCelebrityInfo(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCelebrityRecognitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCelebrityRecognition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetContentModerationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetContentModeration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFaceDetectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFaceDetection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFaceLivenessSessionResultsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFaceLivenessSessionResults(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFaceSearchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFaceSearch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLabelDetectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLabelDetection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMediaAnalysisJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMediaAnalysisJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPersonTrackingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPersonTracking(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSegmentDetectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSegmentDetection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTextDetectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTextDetection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpIndexFacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.IndexFaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCollectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCollections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDatasetEntriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDatasetEntries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDatasetLabelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDatasetLabels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMediaAnalysisJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMediaAnalysisJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProjectPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProjectPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStreamProcessorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStreamProcessors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUsersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUsers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutProjectPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutProjectPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRecognizeCelebritiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RecognizeCelebrities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchFacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchFaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchFacesByImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchFacesByImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchUsersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchUsers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchUsersByImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchUsersByImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartCelebrityRecognitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartCelebrityRecognition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartContentModerationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartContentModeration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartFaceDetectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartFaceDetection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartFaceSearchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartFaceSearch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartLabelDetectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartLabelDetection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMediaAnalysisJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMediaAnalysisJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartPersonTrackingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartPersonTracking(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartProjectVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartProjectVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartSegmentDetectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartSegmentDetection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartStreamProcessorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartStreamProcessor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartTextDetectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartTextDetection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopProjectVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopProjectVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopStreamProcessorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopStreamProcessor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDatasetEntriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDatasetEntries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateStreamProcessorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateStreamProcessor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/repostspace/generated.json b/service/repostspace/generated.json index 191adc8c4bf..3ad601bda68 100644 --- a/service/repostspace/generated.json +++ b/service/repostspace/generated.json @@ -34,6 +34,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/repostspace/sra_operation_order_test.go b/service/repostspace/sra_operation_order_test.go new file mode 100644 index 00000000000..d20899f730c --- /dev/null +++ b/service/repostspace/sra_operation_order_test.go @@ -0,0 +1,476 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package repostspace + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchAddRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchAddRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchRemoveRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchRemoveRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSpaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSpace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSpaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSpace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterAdminSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterAdmin(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSpaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSpace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSpacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSpaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterAdminSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterAdmin(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendInvitesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendInvites(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSpaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSpace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/resiliencehub/generated.json b/service/resiliencehub/generated.json index b97ebb9e5a6..a59832b5fa6 100644 --- a/service/resiliencehub/generated.json +++ b/service/resiliencehub/generated.json @@ -84,6 +84,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/resiliencehub/sra_operation_order_test.go b/service/resiliencehub/sra_operation_order_test.go new file mode 100644 index 00000000000..ef7a25c7dd9 --- /dev/null +++ b/service/resiliencehub/sra_operation_order_test.go @@ -0,0 +1,2226 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resiliencehub + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcceptResourceGroupingRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptResourceGroupingRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddDraftAppVersionResourceMappingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddDraftAppVersionResourceMappings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchUpdateRecommendationStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchUpdateRecommendationStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAppVersionAppComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAppVersionAppComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAppVersionResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAppVersionResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRecommendationTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRecommendationTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateResiliencyPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateResiliencyPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAppAssessmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAppAssessment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAppInputSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAppInputSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAppVersionAppComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAppVersionAppComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAppVersionResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAppVersionResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRecommendationTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRecommendationTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResiliencyPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResiliencyPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAppAssessmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAppAssessment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAppVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAppVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAppVersionAppComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAppVersionAppComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAppVersionResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAppVersionResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAppVersionResourcesResolutionStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAppVersionResourcesResolutionStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAppVersionTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAppVersionTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDraftAppVersionResourcesImportStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDraftAppVersionResourcesImportStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMetricsExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMetricsExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeResiliencyPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeResiliencyPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeResourceGroupingRecommendationTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeResourceGroupingRecommendationTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportResourcesToDraftAppVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportResourcesToDraftAppVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAlarmRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAlarmRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAppAssessmentComplianceDriftsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAppAssessmentComplianceDrifts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAppAssessmentResourceDriftsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAppAssessmentResourceDrifts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAppAssessmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAppAssessments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAppComponentCompliancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAppComponentCompliances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAppComponentRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAppComponentRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAppInputSourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAppInputSources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAppsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAppVersionAppComponentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAppVersionAppComponents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAppVersionResourceMappingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAppVersionResourceMappings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAppVersionResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAppVersionResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAppVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAppVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMetricsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMetrics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRecommendationTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRecommendationTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResiliencyPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResiliencyPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceGroupingRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceGroupingRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSopRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSopRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSuggestedResiliencyPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSuggestedResiliencyPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTestRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTestRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUnsupportedAppVersionResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUnsupportedAppVersionResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPublishAppVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PublishAppVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutDraftAppVersionTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutDraftAppVersionTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRejectResourceGroupingRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RejectResourceGroupingRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveDraftAppVersionResourceMappingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveDraftAppVersionResourceMappings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResolveAppVersionResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResolveAppVersionResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartAppAssessmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartAppAssessment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMetricsExportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMetricsExport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartResourceGroupingRecommendationTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartResourceGroupingRecommendationTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAppVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAppVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAppVersionAppComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAppVersionAppComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAppVersionResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAppVersionResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateResiliencyPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateResiliencyPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/resourceexplorer2/generated.json b/service/resourceexplorer2/generated.json index 3ea15bc73ee..2fc78066b2e 100644 --- a/service/resourceexplorer2/generated.json +++ b/service/resourceexplorer2/generated.json @@ -49,6 +49,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/resourceexplorer2/sra_operation_order_test.go b/service/resourceexplorer2/sra_operation_order_test.go new file mode 100644 index 00000000000..e82e584b62b --- /dev/null +++ b/service/resourceexplorer2/sra_operation_order_test.go @@ -0,0 +1,861 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourceexplorer2 + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateDefaultViewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateDefaultView(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetViewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetView(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIndexSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIndex(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateViewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateView(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIndexSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIndex(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteViewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteView(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateDefaultViewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateDefaultView(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccountLevelServiceConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccountLevelServiceConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDefaultViewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDefaultView(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIndexSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIndex(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetManagedViewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetManagedView(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetViewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetView(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIndexesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIndexes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIndexesForMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIndexesForMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListManagedViewsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListManagedViews(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSupportedResourceTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSupportedResourceTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListViewsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListViews(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Search(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIndexTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIndexType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateViewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateView(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/resourcegroups/generated.json b/service/resourcegroups/generated.json index ab5c3b98f34..ba3bfd2ce64 100644 --- a/service/resourcegroups/generated.json +++ b/service/resourcegroups/generated.json @@ -44,6 +44,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/resourcegroups/sra_operation_order_test.go b/service/resourcegroups/sra_operation_order_test.go new file mode 100644 index 00000000000..6df4a4302a8 --- /dev/null +++ b/service/resourcegroups/sra_operation_order_test.go @@ -0,0 +1,826 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourcegroups + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCancelTagSyncTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelTagSyncTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccountSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccountSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGroupConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGroupConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGroupQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGroupQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTagSyncTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTagSyncTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGroupResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GroupResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGroupingStatusesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGroupingStatuses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGroupResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGroupResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagSyncTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagSyncTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutGroupConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutGroupConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartTagSyncTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartTagSyncTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Tag(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUngroupResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UngroupResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Untag(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAccountSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAccountSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGroupQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGroupQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/resourcegroupstaggingapi/generated.json b/service/resourcegroupstaggingapi/generated.json index 82b126cbc70..f08824bced8 100644 --- a/service/resourcegroupstaggingapi/generated.json +++ b/service/resourcegroupstaggingapi/generated.json @@ -29,6 +29,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/resourcegroupstaggingapi/sra_operation_order_test.go b/service/resourcegroupstaggingapi/sra_operation_order_test.go new file mode 100644 index 00000000000..3a6fc5ce270 --- /dev/null +++ b/service/resourcegroupstaggingapi/sra_operation_order_test.go @@ -0,0 +1,301 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resourcegroupstaggingapi + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpDescribeReportCreationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReportCreation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetComplianceSummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetComplianceSummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTagKeysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTagKeys(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTagValuesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTagValues(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartReportCreationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartReportCreation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/robomaker/generated.json b/service/robomaker/generated.json index 65ee3dd4aa6..9b62f97acc5 100644 --- a/service/robomaker/generated.json +++ b/service/robomaker/generated.json @@ -78,6 +78,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/robomaker/sra_operation_order_test.go b/service/robomaker/sra_operation_order_test.go new file mode 100644 index 00000000000..d26c3ace6c3 --- /dev/null +++ b/service/robomaker/sra_operation_order_test.go @@ -0,0 +1,2016 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package robomaker + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchDeleteWorldsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteWorlds(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDescribeSimulationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDescribeSimulationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelDeploymentJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelDeploymentJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelSimulationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelSimulationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelSimulationJobBatchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelSimulationJobBatch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelWorldExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelWorldExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelWorldGenerationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelWorldGenerationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDeploymentJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDeploymentJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRobotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRobot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRobotApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRobotApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRobotApplicationVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRobotApplicationVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSimulationApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSimulationApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSimulationApplicationVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSimulationApplicationVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSimulationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSimulationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorldExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorldExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorldGenerationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorldGenerationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorldTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorldTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRobotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRobot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRobotApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRobotApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSimulationApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSimulationApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWorldTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWorldTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterRobotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterRobot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDeploymentJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDeploymentJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRobotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRobot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRobotApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRobotApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSimulationApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSimulationApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSimulationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSimulationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSimulationJobBatchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSimulationJobBatch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWorldSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWorld(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWorldExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWorldExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWorldGenerationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWorldGenerationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWorldTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWorldTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWorldTemplateBodySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWorldTemplateBody(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDeploymentJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDeploymentJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFleetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFleets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRobotApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRobotApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRobotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRobots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSimulationApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSimulationApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSimulationJobBatchesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSimulationJobBatches(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSimulationJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSimulationJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorldExportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorldExportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorldGenerationJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorldGenerationJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorldsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorlds(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorldTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorldTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterRobotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterRobot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestartSimulationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestartSimulationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartSimulationJobBatchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartSimulationJobBatch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSyncDeploymentJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SyncDeploymentJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRobotApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRobotApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSimulationApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSimulationApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWorldTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWorldTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/rolesanywhere/generated.json b/service/rolesanywhere/generated.json index 9cf2e56bb23..3a0bdfb7361 100644 --- a/service/rolesanywhere/generated.json +++ b/service/rolesanywhere/generated.json @@ -51,6 +51,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/rolesanywhere/sra_operation_order_test.go b/service/rolesanywhere/sra_operation_order_test.go new file mode 100644 index 00000000000..e5e2fbc6b8a --- /dev/null +++ b/service/rolesanywhere/sra_operation_order_test.go @@ -0,0 +1,1071 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rolesanywhere + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTrustAnchorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTrustAnchor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAttributeMappingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAttributeMapping(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTrustAnchorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTrustAnchor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableCrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableCrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableTrustAnchorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableTrustAnchor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableCrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableCrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableTrustAnchorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableTrustAnchor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSubjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSubject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTrustAnchorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTrustAnchor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportCrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportCrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCrlsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCrls(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSubjectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSubjects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTrustAnchorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTrustAnchors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAttributeMappingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAttributeMapping(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutNotificationSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutNotificationSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetNotificationSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetNotificationSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTrustAnchorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTrustAnchor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/route53/generated.json b/service/route53/generated.json index b346684ede5..3fe1cbb9b7e 100644 --- a/service/route53/generated.json +++ b/service/route53/generated.json @@ -91,6 +91,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/route53/sra_operation_order_test.go b/service/route53/sra_operation_order_test.go new file mode 100644 index 00000000000..3cf3e80ffbf --- /dev/null +++ b/service/route53/sra_operation_order_test.go @@ -0,0 +1,2471 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package route53 + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpActivateKeySigningKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ActivateKeySigningKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateVPCWithHostedZoneSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateVPCWithHostedZone(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpChangeCidrCollectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ChangeCidrCollection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpChangeResourceRecordSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ChangeResourceRecordSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpChangeTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ChangeTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCidrCollectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCidrCollection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateHealthCheckSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateHealthCheck(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateHostedZoneSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateHostedZone(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateKeySigningKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateKeySigningKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateQueryLoggingConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateQueryLoggingConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateReusableDelegationSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateReusableDelegationSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTrafficPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTrafficPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTrafficPolicyInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTrafficPolicyInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTrafficPolicyVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTrafficPolicyVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVPCAssociationAuthorizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVPCAssociationAuthorization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeactivateKeySigningKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeactivateKeySigningKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCidrCollectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCidrCollection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteHealthCheckSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteHealthCheck(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteHostedZoneSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteHostedZone(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteKeySigningKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteKeySigningKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteQueryLoggingConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteQueryLoggingConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteReusableDelegationSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteReusableDelegationSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTrafficPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTrafficPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTrafficPolicyInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTrafficPolicyInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVPCAssociationAuthorizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVPCAssociationAuthorization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableHostedZoneDNSSECSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableHostedZoneDNSSEC(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateVPCFromHostedZoneSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateVPCFromHostedZone(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableHostedZoneDNSSECSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableHostedZoneDNSSEC(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccountLimitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccountLimit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetChangeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetChange(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCheckerIpRangesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCheckerIpRanges(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDNSSECSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDNSSEC(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGeoLocationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGeoLocation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetHealthCheckSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetHealthCheck(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetHealthCheckCountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetHealthCheckCount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetHealthCheckLastFailureReasonSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetHealthCheckLastFailureReason(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetHealthCheckStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetHealthCheckStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetHostedZoneSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetHostedZone(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetHostedZoneCountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetHostedZoneCount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetHostedZoneLimitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetHostedZoneLimit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQueryLoggingConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQueryLoggingConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReusableDelegationSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReusableDelegationSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReusableDelegationSetLimitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReusableDelegationSetLimit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTrafficPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTrafficPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTrafficPolicyInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTrafficPolicyInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTrafficPolicyInstanceCountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTrafficPolicyInstanceCount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCidrBlocksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCidrBlocks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCidrCollectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCidrCollections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCidrLocationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCidrLocations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGeoLocationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGeoLocations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListHealthChecksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListHealthChecks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListHostedZonesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListHostedZones(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListHostedZonesByNameSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListHostedZonesByName(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListHostedZonesByVPCSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListHostedZonesByVPC(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListQueryLoggingConfigsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListQueryLoggingConfigs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceRecordSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceRecordSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReusableDelegationSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReusableDelegationSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTrafficPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTrafficPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTrafficPolicyInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTrafficPolicyInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTrafficPolicyInstancesByHostedZoneSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTrafficPolicyInstancesByHostedZone(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTrafficPolicyInstancesByPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTrafficPolicyInstancesByPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTrafficPolicyVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTrafficPolicyVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVPCAssociationAuthorizationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVPCAssociationAuthorizations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestDNSAnswerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestDNSAnswer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateHealthCheckSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateHealthCheck(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateHostedZoneCommentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateHostedZoneComment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTrafficPolicyCommentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTrafficPolicyComment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTrafficPolicyInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTrafficPolicyInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/route53domains/generated.json b/service/route53domains/generated.json index 32cc534b310..f96349e6798 100644 --- a/service/route53domains/generated.json +++ b/service/route53domains/generated.json @@ -55,6 +55,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/route53domains/sra_operation_order_test.go b/service/route53domains/sra_operation_order_test.go new file mode 100644 index 00000000000..640131154e5 --- /dev/null +++ b/service/route53domains/sra_operation_order_test.go @@ -0,0 +1,1211 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package route53domains + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcceptDomainTransferFromAnotherAwsAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptDomainTransferFromAnotherAwsAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateDelegationSignerToDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateDelegationSignerToDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelDomainTransferToAnotherAwsAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelDomainTransferToAnotherAwsAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCheckDomainAvailabilitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CheckDomainAvailability(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCheckDomainTransferabilitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CheckDomainTransferability(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTagsForDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTagsForDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableDomainAutoRenewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableDomainAutoRenew(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableDomainTransferLockSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableDomainTransferLock(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateDelegationSignerFromDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateDelegationSignerFromDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableDomainAutoRenewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableDomainAutoRenew(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableDomainTransferLockSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableDomainTransferLock(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetContactReachabilityStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetContactReachabilityStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDomainDetailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDomainDetail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDomainSuggestionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDomainSuggestions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOperationDetailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOperationDetail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDomainsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDomains(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOperationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOperations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPricesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPrices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPushDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PushDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRejectDomainTransferFromAnotherAwsAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RejectDomainTransferFromAnotherAwsAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRenewDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RenewDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResendContactReachabilityEmailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResendContactReachabilityEmail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResendOperationAuthorizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResendOperationAuthorization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRetrieveDomainAuthCodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RetrieveDomainAuthCode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTransferDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TransferDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTransferDomainToAnotherAwsAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TransferDomainToAnotherAwsAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDomainContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDomainContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDomainContactPrivacySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDomainContactPrivacy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDomainNameserversSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDomainNameservers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTagsForDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTagsForDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpViewBillingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ViewBilling(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/route53profiles/generated.json b/service/route53profiles/generated.json index 86eedebd49b..19749b21fa2 100644 --- a/service/route53profiles/generated.json +++ b/service/route53profiles/generated.json @@ -37,6 +37,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/route53profiles/sra_operation_order_test.go b/service/route53profiles/sra_operation_order_test.go new file mode 100644 index 00000000000..beeb5e41169 --- /dev/null +++ b/service/route53profiles/sra_operation_order_test.go @@ -0,0 +1,581 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package route53profiles + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateResourceToProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateResourceToProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateResourceFromProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateResourceFromProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetProfileAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetProfileAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetProfileResourceAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetProfileResourceAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProfileAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProfileAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProfileResourceAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProfileResourceAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProfileResourceAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProfileResourceAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/route53recoverycluster/generated.json b/service/route53recoverycluster/generated.json index 7359ebd57c3..c5b095d4b16 100644 --- a/service/route53recoverycluster/generated.json +++ b/service/route53recoverycluster/generated.json @@ -25,6 +25,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/route53recoverycluster/sra_operation_order_test.go b/service/route53recoverycluster/sra_operation_order_test.go new file mode 100644 index 00000000000..58b1e36ba31 --- /dev/null +++ b/service/route53recoverycluster/sra_operation_order_test.go @@ -0,0 +1,161 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package route53recoverycluster + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpGetRoutingControlStateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRoutingControlState(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRoutingControlsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRoutingControls(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRoutingControlStateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRoutingControlState(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRoutingControlStatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRoutingControlStates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/route53recoverycontrolconfig/generated.json b/service/route53recoverycontrolconfig/generated.json index 3d2c75eac25..cd79f4b93a6 100644 --- a/service/route53recoverycontrolconfig/generated.json +++ b/service/route53recoverycontrolconfig/generated.json @@ -45,6 +45,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/route53recoverycontrolconfig/sra_operation_order_test.go b/service/route53recoverycontrolconfig/sra_operation_order_test.go new file mode 100644 index 00000000000..acd27e5a23a --- /dev/null +++ b/service/route53recoverycontrolconfig/sra_operation_order_test.go @@ -0,0 +1,861 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package route53recoverycontrolconfig + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateControlPanelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateControlPanel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRoutingControlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRoutingControl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSafetyRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSafetyRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteControlPanelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteControlPanel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRoutingControlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRoutingControl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSafetyRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSafetyRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeControlPanelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeControlPanel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRoutingControlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRoutingControl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSafetyRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSafetyRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssociatedRoute53HealthChecksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssociatedRoute53HealthChecks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListControlPanelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListControlPanels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRoutingControlsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRoutingControls(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSafetyRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSafetyRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateControlPanelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateControlPanel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRoutingControlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRoutingControl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSafetyRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSafetyRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/route53recoveryreadiness/generated.json b/service/route53recoveryreadiness/generated.json index 14cfbf94ef6..e8e3bb9f8a5 100644 --- a/service/route53recoveryreadiness/generated.json +++ b/service/route53recoveryreadiness/generated.json @@ -53,6 +53,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/route53recoveryreadiness/sra_operation_order_test.go b/service/route53recoveryreadiness/sra_operation_order_test.go new file mode 100644 index 00000000000..7cc7f67df07 --- /dev/null +++ b/service/route53recoveryreadiness/sra_operation_order_test.go @@ -0,0 +1,1141 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package route53recoveryreadiness + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateCellSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCell(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCrossAccountAuthorizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCrossAccountAuthorization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateReadinessCheckSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateReadinessCheck(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRecoveryGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRecoveryGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateResourceSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateResourceSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCellSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCell(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCrossAccountAuthorizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCrossAccountAuthorization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteReadinessCheckSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteReadinessCheck(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRecoveryGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRecoveryGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourceSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourceSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetArchitectureRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetArchitectureRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCellSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCell(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCellReadinessSummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCellReadinessSummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReadinessCheckSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReadinessCheck(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReadinessCheckResourceStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReadinessCheckResourceStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReadinessCheckStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReadinessCheckStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRecoveryGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRecoveryGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRecoveryGroupReadinessSummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRecoveryGroupReadinessSummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourceSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourceSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCellsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCells(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCrossAccountAuthorizationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCrossAccountAuthorizations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReadinessChecksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReadinessChecks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRecoveryGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRecoveryGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCellSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCell(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateReadinessCheckSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateReadinessCheck(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRecoveryGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRecoveryGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateResourceSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateResourceSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/route53resolver/generated.json b/service/route53resolver/generated.json index 2aacf451df1..c8db96357ae 100644 --- a/service/route53resolver/generated.json +++ b/service/route53resolver/generated.json @@ -89,6 +89,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/route53resolver/sra_operation_order_test.go b/service/route53resolver/sra_operation_order_test.go new file mode 100644 index 00000000000..2cff778c87f --- /dev/null +++ b/service/route53resolver/sra_operation_order_test.go @@ -0,0 +1,2401 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package route53resolver + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateFirewallRuleGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateFirewallRuleGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateResolverEndpointIpAddressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateResolverEndpointIpAddress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateResolverQueryLogConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateResolverQueryLogConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateResolverRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateResolverRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFirewallDomainListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFirewallDomainList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFirewallRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFirewallRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFirewallRuleGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFirewallRuleGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateOutpostResolverSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateOutpostResolver(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateResolverEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateResolverEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateResolverQueryLogConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateResolverQueryLogConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateResolverRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateResolverRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFirewallDomainListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFirewallDomainList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFirewallRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFirewallRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFirewallRuleGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFirewallRuleGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteOutpostResolverSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteOutpostResolver(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResolverEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResolverEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResolverQueryLogConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResolverQueryLogConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResolverRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResolverRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateFirewallRuleGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateFirewallRuleGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateResolverEndpointIpAddressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateResolverEndpointIpAddress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateResolverQueryLogConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateResolverQueryLogConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateResolverRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateResolverRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFirewallConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFirewallConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFirewallDomainListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFirewallDomainList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFirewallRuleGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFirewallRuleGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFirewallRuleGroupAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFirewallRuleGroupAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFirewallRuleGroupPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFirewallRuleGroupPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOutpostResolverSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOutpostResolver(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResolverConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResolverConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResolverDnssecConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResolverDnssecConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResolverEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResolverEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResolverQueryLogConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResolverQueryLogConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResolverQueryLogConfigAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResolverQueryLogConfigAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResolverQueryLogConfigPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResolverQueryLogConfigPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResolverRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResolverRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResolverRuleAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResolverRuleAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResolverRulePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResolverRulePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportFirewallDomainsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportFirewallDomains(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFirewallConfigsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFirewallConfigs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFirewallDomainListsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFirewallDomainLists(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFirewallDomainsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFirewallDomains(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFirewallRuleGroupAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFirewallRuleGroupAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFirewallRuleGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFirewallRuleGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFirewallRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFirewallRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOutpostResolversSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOutpostResolvers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResolverConfigsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResolverConfigs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResolverDnssecConfigsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResolverDnssecConfigs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResolverEndpointIpAddressesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResolverEndpointIpAddresses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResolverEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResolverEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResolverQueryLogConfigAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResolverQueryLogConfigAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResolverQueryLogConfigsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResolverQueryLogConfigs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResolverRuleAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResolverRuleAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResolverRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResolverRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutFirewallRuleGroupPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutFirewallRuleGroupPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResolverQueryLogConfigPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResolverQueryLogConfigPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResolverRulePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResolverRulePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFirewallConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFirewallConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFirewallDomainsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFirewallDomains(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFirewallRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFirewallRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFirewallRuleGroupAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFirewallRuleGroupAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateOutpostResolverSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateOutpostResolver(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateResolverConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateResolverConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateResolverDnssecConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateResolverDnssecConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateResolverEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateResolverEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateResolverRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateResolverRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/rum/generated.json b/service/rum/generated.json index faeade211c8..47cac43a8b2 100644 --- a/service/rum/generated.json +++ b/service/rum/generated.json @@ -41,6 +41,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/rum/sra_operation_order_test.go b/service/rum/sra_operation_order_test.go new file mode 100644 index 00000000000..543b172e773 --- /dev/null +++ b/service/rum/sra_operation_order_test.go @@ -0,0 +1,616 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rum + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchCreateRumMetricDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchCreateRumMetricDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeleteRumMetricDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteRumMetricDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetRumMetricDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetRumMetricDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAppMonitorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAppMonitor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAppMonitorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAppMonitor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRumMetricsDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRumMetricsDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAppMonitorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAppMonitor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAppMonitorDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAppMonitorData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAppMonitorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAppMonitors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRumMetricsDestinationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRumMetricsDestinations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRumEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRumEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRumMetricsDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRumMetricsDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAppMonitorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAppMonitor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRumMetricDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRumMetricDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/s3/generated.json b/service/s3/generated.json index c94baae119a..fa0119bcb31 100644 --- a/service/s3/generated.json +++ b/service/s3/generated.json @@ -126,6 +126,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/s3/sra_operation_order_test.go b/service/s3/sra_operation_order_test.go new file mode 100644 index 00000000000..6469f3e3d21 --- /dev/null +++ b/service/s3/sra_operation_order_test.go @@ -0,0 +1,3451 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3 + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAbortMultipartUploadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AbortMultipartUpload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCompleteMultipartUploadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CompleteMultipartUpload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCopyObjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopyObject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBucketSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBucket(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBucketMetadataTableConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBucketMetadataTableConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMultipartUploadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMultipartUpload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBucketSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBucket(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBucketAnalyticsConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBucketAnalyticsConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBucketCorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBucketCors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBucketEncryptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBucketEncryption(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBucketIntelligentTieringConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBucketIntelligentTieringConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBucketInventoryConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBucketInventoryConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBucketLifecycleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBucketLifecycle(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBucketMetadataTableConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBucketMetadataTableConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBucketMetricsConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBucketMetricsConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBucketOwnershipControlsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBucketOwnershipControls(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBucketPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBucketPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBucketReplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBucketReplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBucketTaggingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBucketTagging(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBucketWebsiteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBucketWebsite(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteObjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteObject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteObjectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteObjects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteObjectTaggingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteObjectTagging(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePublicAccessBlockSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePublicAccessBlock(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketAccelerateConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketAccelerateConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketAclSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketAcl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketAnalyticsConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketAnalyticsConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketCorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketCors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketEncryptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketEncryption(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketIntelligentTieringConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketIntelligentTieringConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketInventoryConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketInventoryConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketLifecycleConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketLifecycleConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketLocationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketLocation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketLoggingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketLogging(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketMetadataTableConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketMetadataTableConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketMetricsConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketMetricsConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketNotificationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketNotificationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketOwnershipControlsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketOwnershipControls(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketPolicyStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketPolicyStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketReplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketReplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketRequestPaymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketRequestPayment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketTaggingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketTagging(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketVersioningSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketVersioning(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketWebsiteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketWebsite(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetObjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetObject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetObjectAclSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetObjectAcl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetObjectAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetObjectAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetObjectLegalHoldSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetObjectLegalHold(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetObjectLockConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetObjectLockConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetObjectRetentionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetObjectRetention(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetObjectTaggingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetObjectTagging(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetObjectTorrentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetObjectTorrent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPublicAccessBlockSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPublicAccessBlock(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHeadBucketSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HeadBucket(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpHeadObjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.HeadObject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBucketAnalyticsConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBucketAnalyticsConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBucketIntelligentTieringConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBucketIntelligentTieringConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBucketInventoryConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBucketInventoryConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBucketMetricsConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBucketMetricsConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBucketsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBuckets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDirectoryBucketsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDirectoryBuckets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMultipartUploadsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMultipartUploads(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListObjectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListObjects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListObjectsV2SRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListObjectsV2(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListObjectVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListObjectVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPartsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListParts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBucketAccelerateConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBucketAccelerateConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBucketAclSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBucketAcl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBucketAnalyticsConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBucketAnalyticsConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBucketCorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBucketCors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBucketEncryptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBucketEncryption(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBucketIntelligentTieringConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBucketIntelligentTieringConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBucketInventoryConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBucketInventoryConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBucketLifecycleConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBucketLifecycleConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBucketLoggingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBucketLogging(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBucketMetricsConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBucketMetricsConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBucketNotificationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBucketNotificationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBucketOwnershipControlsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBucketOwnershipControls(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBucketPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBucketPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBucketReplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBucketReplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBucketRequestPaymentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBucketRequestPayment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBucketTaggingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBucketTagging(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBucketVersioningSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBucketVersioning(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBucketWebsiteSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBucketWebsite(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutObjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutObject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutObjectAclSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutObjectAcl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutObjectLegalHoldSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutObjectLegalHold(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutObjectLockConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutObjectLockConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutObjectRetentionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutObjectRetention(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutObjectTaggingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutObjectTagging(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutPublicAccessBlockSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutPublicAccessBlock(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreObjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreObject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSelectObjectContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SelectObjectContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUploadPartSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UploadPart(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUploadPartCopySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UploadPartCopy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpWriteGetObjectResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.WriteGetObjectResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/s3control/generated.json b/service/s3control/generated.json index ac7446491d8..83a87880c04 100644 --- a/service/s3control/generated.json +++ b/service/s3control/generated.json @@ -116,6 +116,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/s3control/sra_operation_order_test.go b/service/s3control/sra_operation_order_test.go new file mode 100644 index 00000000000..d98401b3370 --- /dev/null +++ b/service/s3control/sra_operation_order_test.go @@ -0,0 +1,3276 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3control + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateAccessGrantsIdentityCenterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateAccessGrantsIdentityCenter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAccessGrantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAccessGrant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAccessGrantsInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAccessGrantsInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAccessGrantsLocationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAccessGrantsLocation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAccessPointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAccessPoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAccessPointForObjectLambdaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAccessPointForObjectLambda(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBucketSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBucket(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMultiRegionAccessPointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMultiRegionAccessPoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStorageLensGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStorageLensGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccessGrantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccessGrant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccessGrantsInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccessGrantsInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccessGrantsInstanceResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccessGrantsInstanceResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccessGrantsLocationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccessGrantsLocation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccessPointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccessPoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccessPointForObjectLambdaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccessPointForObjectLambda(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccessPointPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccessPointPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccessPointPolicyForObjectLambdaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccessPointPolicyForObjectLambda(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBucketSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBucket(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBucketLifecycleConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBucketLifecycleConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBucketPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBucketPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBucketReplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBucketReplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBucketTaggingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBucketTagging(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteJobTaggingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteJobTagging(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMultiRegionAccessPointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMultiRegionAccessPoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePublicAccessBlockSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePublicAccessBlock(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteStorageLensConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteStorageLensConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteStorageLensConfigurationTaggingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteStorageLensConfigurationTagging(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteStorageLensGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteStorageLensGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMultiRegionAccessPointOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMultiRegionAccessPointOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDissociateAccessGrantsIdentityCenterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DissociateAccessGrantsIdentityCenter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccessGrantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccessGrant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccessGrantsInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccessGrantsInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccessGrantsInstanceForPrefixSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccessGrantsInstanceForPrefix(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccessGrantsInstanceResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccessGrantsInstanceResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccessGrantsLocationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccessGrantsLocation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccessPointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccessPoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccessPointConfigurationForObjectLambdaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccessPointConfigurationForObjectLambda(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccessPointForObjectLambdaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccessPointForObjectLambda(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccessPointPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccessPointPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccessPointPolicyForObjectLambdaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccessPointPolicyForObjectLambda(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccessPointPolicyStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccessPointPolicyStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccessPointPolicyStatusForObjectLambdaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccessPointPolicyStatusForObjectLambda(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucket(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketLifecycleConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketLifecycleConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketReplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketReplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketTaggingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketTagging(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBucketVersioningSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBucketVersioning(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetJobTaggingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetJobTagging(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMultiRegionAccessPointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMultiRegionAccessPoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMultiRegionAccessPointPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMultiRegionAccessPointPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMultiRegionAccessPointPolicyStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMultiRegionAccessPointPolicyStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMultiRegionAccessPointRoutesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMultiRegionAccessPointRoutes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPublicAccessBlockSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPublicAccessBlock(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStorageLensConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStorageLensConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStorageLensConfigurationTaggingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStorageLensConfigurationTagging(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetStorageLensGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetStorageLensGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccessGrantsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccessGrants(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccessGrantsInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccessGrantsInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccessGrantsLocationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccessGrantsLocations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccessPointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccessPoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccessPointsForObjectLambdaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccessPointsForObjectLambda(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCallerAccessGrantsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCallerAccessGrants(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMultiRegionAccessPointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMultiRegionAccessPoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRegionalBucketsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRegionalBuckets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStorageLensConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStorageLensConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStorageLensGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStorageLensGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAccessGrantsInstanceResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAccessGrantsInstanceResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAccessPointConfigurationForObjectLambdaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAccessPointConfigurationForObjectLambda(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAccessPointPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAccessPointPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAccessPointPolicyForObjectLambdaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAccessPointPolicyForObjectLambda(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBucketLifecycleConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBucketLifecycleConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBucketPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBucketPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBucketReplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBucketReplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBucketTaggingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBucketTagging(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutBucketVersioningSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutBucketVersioning(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutJobTaggingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutJobTagging(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutMultiRegionAccessPointPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutMultiRegionAccessPointPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutPublicAccessBlockSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutPublicAccessBlock(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutStorageLensConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutStorageLensConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutStorageLensConfigurationTaggingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutStorageLensConfigurationTagging(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSubmitMultiRegionAccessPointRoutesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SubmitMultiRegionAccessPointRoutes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAccessGrantsLocationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAccessGrantsLocation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateJobPrioritySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateJobPriority(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateJobStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateJobStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateStorageLensGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateStorageLensGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/s3outposts/generated.json b/service/s3outposts/generated.json index b58fb3e49b5..100af8622d4 100644 --- a/service/s3outposts/generated.json +++ b/service/s3outposts/generated.json @@ -26,6 +26,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/s3outposts/sra_operation_order_test.go b/service/s3outposts/sra_operation_order_test.go new file mode 100644 index 00000000000..e856b2a80ac --- /dev/null +++ b/service/s3outposts/sra_operation_order_test.go @@ -0,0 +1,196 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3outposts + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOutpostsWithS3SRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOutpostsWithS3(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSharedEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSharedEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/s3tables/generated.json b/service/s3tables/generated.json index bf7ffa2a6d7..1df21f0475d 100644 --- a/service/s3tables/generated.json +++ b/service/s3tables/generated.json @@ -47,6 +47,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/s3tables/sra_operation_order_test.go b/service/s3tables/sra_operation_order_test.go new file mode 100644 index 00000000000..868a2db68cd --- /dev/null +++ b/service/s3tables/sra_operation_order_test.go @@ -0,0 +1,931 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package s3tables + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTableBucketSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTableBucket(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTableBucketSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTableBucket(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTableBucketPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTableBucketPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTablePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTablePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTableBucketSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTableBucket(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTableBucketMaintenanceConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTableBucketMaintenanceConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTableBucketPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTableBucketPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTableMaintenanceConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTableMaintenanceConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTableMaintenanceJobStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTableMaintenanceJobStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTableMetadataLocationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTableMetadataLocation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTablePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTablePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNamespacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNamespaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTableBucketsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTableBuckets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTablesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTables(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutTableBucketMaintenanceConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutTableBucketMaintenanceConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutTableBucketPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutTableBucketPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutTableMaintenanceConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutTableMaintenanceConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutTablePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutTablePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRenameTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RenameTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTableMetadataLocationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTableMetadataLocation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/sagemaker/generated.json b/service/sagemaker/generated.json index e094da702ea..670a541cad0 100644 --- a/service/sagemaker/generated.json +++ b/service/sagemaker/generated.json @@ -379,6 +379,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/sagemaker/sra_operation_order_test.go b/service/sagemaker/sra_operation_order_test.go new file mode 100644 index 00000000000..4a278753765 --- /dev/null +++ b/service/sagemaker/sra_operation_order_test.go @@ -0,0 +1,12551 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sagemaker + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateTrialComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateTrialComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeleteClusterNodesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteClusterNodes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDescribeModelPackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDescribeModelPackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAlgorithmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAlgorithm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAppImageConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAppImageConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateArtifactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateArtifact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAutoMLJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAutoMLJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAutoMLJobV2SRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAutoMLJobV2(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateClusterSchedulerConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateClusterSchedulerConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCodeRepositorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCodeRepository(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCompilationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCompilationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateComputeQuotaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateComputeQuota(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateContextSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateContext(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataQualityJobDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataQualityJobDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDeviceFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDeviceFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEdgeDeploymentPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEdgeDeploymentPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEdgeDeploymentStageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEdgeDeploymentStage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEdgePackagingJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEdgePackagingJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEndpointConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEndpointConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateExperimentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateExperiment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFeatureGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFeatureGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFlowDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFlowDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateHubSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateHub(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateHubContentReferenceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateHubContentReference(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateHumanTaskUiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateHumanTaskUi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateHyperParameterTuningJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateHyperParameterTuningJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateImageVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateImageVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInferenceComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInferenceComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInferenceExperimentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInferenceExperiment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInferenceRecommendationsJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInferenceRecommendationsJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLabelingJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLabelingJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMlflowTrackingServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMlflowTrackingServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateModelBiasJobDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateModelBiasJobDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateModelCardSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateModelCard(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateModelCardExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateModelCardExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateModelExplainabilityJobDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateModelExplainabilityJobDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateModelPackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateModelPackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateModelPackageGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateModelPackageGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateModelQualityJobDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateModelQualityJobDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMonitoringScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMonitoringSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateNotebookInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNotebookInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateNotebookInstanceLifecycleConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNotebookInstanceLifecycleConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateOptimizationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateOptimizationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePartnerAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePartnerApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePartnerAppPresignedUrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePartnerAppPresignedUrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePresignedDomainUrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePresignedDomainUrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePresignedMlflowTrackingServerUrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePresignedMlflowTrackingServerUrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePresignedNotebookInstanceUrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePresignedNotebookInstanceUrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProcessingJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProcessingJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSpaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSpace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStudioLifecycleConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStudioLifecycleConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTrainingJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTrainingJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTrainingPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTrainingPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTransformJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTransformJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTrialSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTrial(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTrialComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTrialComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUserProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUserProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorkforceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorkforce(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorkteamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorkteam(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAlgorithmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAlgorithm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAppImageConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAppImageConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteArtifactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteArtifact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteClusterSchedulerConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteClusterSchedulerConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCodeRepositorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCodeRepository(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCompilationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCompilationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteComputeQuotaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteComputeQuota(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteContextSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteContext(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataQualityJobDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataQualityJobDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDeviceFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDeviceFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEdgeDeploymentPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEdgeDeploymentPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEdgeDeploymentStageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEdgeDeploymentStage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEndpointConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEndpointConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteExperimentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteExperiment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFeatureGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFeatureGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFlowDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFlowDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteHubSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteHub(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteHubContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteHubContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteHubContentReferenceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteHubContentReference(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteHumanTaskUiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteHumanTaskUi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteHyperParameterTuningJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteHyperParameterTuningJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteImageVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteImageVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInferenceComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInferenceComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInferenceExperimentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInferenceExperiment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMlflowTrackingServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMlflowTrackingServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteModelBiasJobDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteModelBiasJobDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteModelCardSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteModelCard(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteModelExplainabilityJobDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteModelExplainabilityJobDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteModelPackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteModelPackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteModelPackageGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteModelPackageGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteModelPackageGroupPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteModelPackageGroupPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteModelQualityJobDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteModelQualityJobDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMonitoringScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMonitoringSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNotebookInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNotebookInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNotebookInstanceLifecycleConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNotebookInstanceLifecycleConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteOptimizationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteOptimizationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePartnerAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePartnerApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSpaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSpace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteStudioLifecycleConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteStudioLifecycleConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTrialSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTrial(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTrialComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTrialComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUserProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWorkforceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWorkforce(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWorkteamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWorkteam(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterDevicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterDevices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAlgorithmSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAlgorithm(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAppImageConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAppImageConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeArtifactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeArtifact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAutoMLJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAutoMLJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAutoMLJobV2SRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAutoMLJobV2(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClusterNodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeClusterNode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClusterSchedulerConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeClusterSchedulerConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCodeRepositorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCodeRepository(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCompilationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCompilationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeComputeQuotaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeComputeQuota(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeContextSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeContext(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDataQualityJobDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDataQualityJobDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDeviceFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDeviceFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEdgeDeploymentPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEdgeDeploymentPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEdgePackagingJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEdgePackagingJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEndpointConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEndpointConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeExperimentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeExperiment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFeatureGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFeatureGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFeatureMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFeatureMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFlowDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFlowDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeHubSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeHub(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeHubContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeHubContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeHumanTaskUiSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeHumanTaskUi(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeHyperParameterTuningJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeHyperParameterTuningJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeImageVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeImageVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInferenceComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInferenceComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInferenceExperimentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInferenceExperiment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInferenceRecommendationsJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInferenceRecommendationsJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLabelingJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLabelingJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLineageGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLineageGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMlflowTrackingServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMlflowTrackingServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeModelBiasJobDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeModelBiasJobDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeModelCardSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeModelCard(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeModelCardExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeModelCardExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeModelExplainabilityJobDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeModelExplainabilityJobDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeModelPackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeModelPackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeModelPackageGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeModelPackageGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeModelQualityJobDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeModelQualityJobDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMonitoringScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMonitoringSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeNotebookInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeNotebookInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeNotebookInstanceLifecycleConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeNotebookInstanceLifecycleConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOptimizationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOptimizationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePartnerAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePartnerApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePipelineDefinitionForExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePipelineDefinitionForExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePipelineExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePipelineExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeProcessingJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeProcessingJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSpaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSpace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStudioLifecycleConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStudioLifecycleConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSubscribedWorkteamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSubscribedWorkteam(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTrainingJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTrainingJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTrainingPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTrainingPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTransformJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTransformJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTrialSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTrial(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTrialComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTrialComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeUserProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeUserProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWorkforceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWorkforce(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWorkteamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWorkteam(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableSagemakerServicecatalogPortfolioSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableSagemakerServicecatalogPortfolio(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateTrialComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateTrialComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableSagemakerServicecatalogPortfolioSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableSagemakerServicecatalogPortfolio(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeviceFleetReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeviceFleetReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLineageGroupPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLineageGroupPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetModelPackageGroupPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetModelPackageGroupPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSagemakerServicecatalogPortfolioStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSagemakerServicecatalogPortfolioStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetScalingConfigurationRecommendationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetScalingConfigurationRecommendation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSearchSuggestionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSearchSuggestions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportHubContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportHubContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAlgorithmsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAlgorithms(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAliasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAliases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAppImageConfigsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAppImageConfigs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAppsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListArtifactsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListArtifacts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAutoMLJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAutoMLJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCandidatesForAutoMLJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCandidatesForAutoMLJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListClusterNodesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListClusterNodes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListClusterSchedulerConfigsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListClusterSchedulerConfigs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCodeRepositoriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCodeRepositories(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCompilationJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCompilationJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListComputeQuotasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListComputeQuotas(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListContextsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListContexts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataQualityJobDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataQualityJobDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDeviceFleetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDeviceFleets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDevicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDevices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDomainsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDomains(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEdgeDeploymentPlansSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEdgeDeploymentPlans(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEdgePackagingJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEdgePackagingJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEndpointConfigsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEndpointConfigs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListExperimentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListExperiments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFeatureGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFeatureGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFlowDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFlowDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListHubContentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListHubContents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListHubContentVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListHubContentVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListHubsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListHubs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListHumanTaskUisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListHumanTaskUis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListHyperParameterTuningJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListHyperParameterTuningJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListImagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListImages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListImageVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListImageVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInferenceComponentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInferenceComponents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInferenceExperimentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInferenceExperiments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInferenceRecommendationsJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInferenceRecommendationsJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInferenceRecommendationsJobStepsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInferenceRecommendationsJobSteps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLabelingJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLabelingJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLabelingJobsForWorkteamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLabelingJobsForWorkteam(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLineageGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLineageGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMlflowTrackingServersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMlflowTrackingServers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListModelBiasJobDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListModelBiasJobDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListModelCardExportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListModelCardExportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListModelCardsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListModelCards(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListModelCardVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListModelCardVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListModelExplainabilityJobDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListModelExplainabilityJobDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListModelMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListModelMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListModelPackageGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListModelPackageGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListModelPackagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListModelPackages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListModelQualityJobDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListModelQualityJobDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListModelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListModels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMonitoringAlertHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMonitoringAlertHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMonitoringAlertsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMonitoringAlerts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMonitoringExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMonitoringExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMonitoringSchedulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMonitoringSchedules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNotebookInstanceLifecycleConfigsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNotebookInstanceLifecycleConfigs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNotebookInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNotebookInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOptimizationJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOptimizationJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPartnerAppsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPartnerApps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPipelineExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPipelineExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPipelineExecutionStepsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPipelineExecutionSteps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPipelineParametersForExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPipelineParametersForExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPipelinesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPipelines(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProcessingJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProcessingJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProjectsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProjects(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceCatalogsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceCatalogs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSpacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSpaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStageDevicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStageDevices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStudioLifecycleConfigsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStudioLifecycleConfigs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSubscribedWorkteamsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSubscribedWorkteams(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTrainingJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTrainingJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTrainingJobsForHyperParameterTuningJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTrainingJobsForHyperParameterTuningJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTrainingPlansSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTrainingPlans(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTransformJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTransformJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTrialComponentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTrialComponents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTrialsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTrials(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUserProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUserProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkforcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkforces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkteamsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkteams(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutModelPackageGroupPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutModelPackageGroupPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpQueryLineageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.QueryLineage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterDevicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterDevices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRenderUiTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RenderUiTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRetryPipelineExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RetryPipelineExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Search(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchTrainingPlanOfferingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchTrainingPlanOfferings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendPipelineExecutionStepFailureSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendPipelineExecutionStepFailure(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendPipelineExecutionStepSuccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendPipelineExecutionStepSuccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartEdgeDeploymentStageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartEdgeDeploymentStage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartInferenceExperimentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartInferenceExperiment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMlflowTrackingServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMlflowTrackingServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMonitoringScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMonitoringSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartNotebookInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartNotebookInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartPipelineExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartPipelineExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopAutoMLJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopAutoMLJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopCompilationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopCompilationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopEdgeDeploymentStageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopEdgeDeploymentStage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopEdgePackagingJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopEdgePackagingJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopHyperParameterTuningJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopHyperParameterTuningJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopInferenceExperimentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopInferenceExperiment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopInferenceRecommendationsJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopInferenceRecommendationsJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopLabelingJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopLabelingJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopMlflowTrackingServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopMlflowTrackingServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopMonitoringScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopMonitoringSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopNotebookInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopNotebookInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopOptimizationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopOptimizationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopPipelineExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopPipelineExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopProcessingJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopProcessingJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopTrainingJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopTrainingJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopTransformJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopTransformJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAppImageConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAppImageConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateArtifactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateArtifact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateClusterSchedulerConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateClusterSchedulerConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateClusterSoftwareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateClusterSoftware(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCodeRepositorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCodeRepository(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateComputeQuotaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateComputeQuota(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateContextSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateContext(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDeviceFleetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDeviceFleet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDevicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDevices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEndpointWeightsAndCapacitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEndpointWeightsAndCapacities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateExperimentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateExperiment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFeatureGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFeatureGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFeatureMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFeatureMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateHubSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateHub(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateHubContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateHubContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateHubContentReferenceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateHubContentReference(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateImageVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateImageVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateInferenceComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateInferenceComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateInferenceComponentRuntimeConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateInferenceComponentRuntimeConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateInferenceExperimentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateInferenceExperiment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMlflowTrackingServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMlflowTrackingServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateModelCardSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateModelCard(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateModelPackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateModelPackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMonitoringAlertSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMonitoringAlert(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMonitoringScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMonitoringSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateNotebookInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateNotebookInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateNotebookInstanceLifecycleConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateNotebookInstanceLifecycleConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePartnerAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePartnerApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePipelineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePipeline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePipelineExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePipelineExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProjectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProject(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSpaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSpace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTrainingJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTrainingJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTrialSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTrial(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTrialComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTrialComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUserProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWorkforceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWorkforce(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWorkteamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWorkteam(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/sagemakera2iruntime/generated.json b/service/sagemakera2iruntime/generated.json index 42cc22a0a9d..047ad8fbbba 100644 --- a/service/sagemakera2iruntime/generated.json +++ b/service/sagemakera2iruntime/generated.json @@ -26,6 +26,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/sagemakera2iruntime/sra_operation_order_test.go b/service/sagemakera2iruntime/sra_operation_order_test.go new file mode 100644 index 00000000000..f20bf1c5519 --- /dev/null +++ b/service/sagemakera2iruntime/sra_operation_order_test.go @@ -0,0 +1,196 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sagemakera2iruntime + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpDeleteHumanLoopSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteHumanLoop(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeHumanLoopSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeHumanLoop(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListHumanLoopsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListHumanLoops(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartHumanLoopSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartHumanLoop(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopHumanLoopSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopHumanLoop(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/sagemakeredge/generated.json b/service/sagemakeredge/generated.json index d9dbeaad5a2..dd66418975d 100644 --- a/service/sagemakeredge/generated.json +++ b/service/sagemakeredge/generated.json @@ -24,6 +24,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/sagemakeredge/sra_operation_order_test.go b/service/sagemakeredge/sra_operation_order_test.go new file mode 100644 index 00000000000..bcad600dd31 --- /dev/null +++ b/service/sagemakeredge/sra_operation_order_test.go @@ -0,0 +1,126 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sagemakeredge + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpGetDeploymentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeployments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeviceRegistrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeviceRegistration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendHeartbeatSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendHeartbeat(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/sagemakerfeaturestoreruntime/generated.json b/service/sagemakerfeaturestoreruntime/generated.json index 173b09a99c5..380a8aa5239 100644 --- a/service/sagemakerfeaturestoreruntime/generated.json +++ b/service/sagemakerfeaturestoreruntime/generated.json @@ -25,6 +25,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/sagemakerfeaturestoreruntime/sra_operation_order_test.go b/service/sagemakerfeaturestoreruntime/sra_operation_order_test.go new file mode 100644 index 00000000000..331715c0249 --- /dev/null +++ b/service/sagemakerfeaturestoreruntime/sra_operation_order_test.go @@ -0,0 +1,161 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sagemakerfeaturestoreruntime + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchGetRecordSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetRecord(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRecordSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRecord(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRecordSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRecord(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRecordSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRecord(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/sagemakergeospatial/generated.json b/service/sagemakergeospatial/generated.json index 3682838bff4..20ac7f6b122 100644 --- a/service/sagemakergeospatial/generated.json +++ b/service/sagemakergeospatial/generated.json @@ -40,6 +40,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/sagemakergeospatial/sra_operation_order_test.go b/service/sagemakergeospatial/sra_operation_order_test.go new file mode 100644 index 00000000000..7cb89be046c --- /dev/null +++ b/service/sagemakergeospatial/sra_operation_order_test.go @@ -0,0 +1,686 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sagemakergeospatial + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpDeleteEarthObservationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEarthObservationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVectorEnrichmentJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVectorEnrichmentJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportEarthObservationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportEarthObservationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportVectorEnrichmentJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportVectorEnrichmentJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEarthObservationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEarthObservationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRasterDataCollectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRasterDataCollection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVectorEnrichmentJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVectorEnrichmentJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEarthObservationJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEarthObservationJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRasterDataCollectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRasterDataCollections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVectorEnrichmentJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVectorEnrichmentJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchRasterDataCollectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchRasterDataCollection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartEarthObservationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartEarthObservationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartVectorEnrichmentJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartVectorEnrichmentJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopEarthObservationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopEarthObservationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopVectorEnrichmentJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopVectorEnrichmentJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/sagemakermetrics/generated.json b/service/sagemakermetrics/generated.json index 6c060772ed4..677d85a359f 100644 --- a/service/sagemakermetrics/generated.json +++ b/service/sagemakermetrics/generated.json @@ -23,6 +23,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/types.go", "validators.go" diff --git a/service/sagemakermetrics/sra_operation_order_test.go b/service/sagemakermetrics/sra_operation_order_test.go new file mode 100644 index 00000000000..71b9b96fb7e --- /dev/null +++ b/service/sagemakermetrics/sra_operation_order_test.go @@ -0,0 +1,91 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sagemakermetrics + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchGetMetricsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetMetrics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchPutMetricsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchPutMetrics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/sagemakerruntime/generated.json b/service/sagemakerruntime/generated.json index 4a0f46a8581..2ddb36ad5f0 100644 --- a/service/sagemakerruntime/generated.json +++ b/service/sagemakerruntime/generated.json @@ -26,6 +26,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/errors.go", "types/types.go", "types/types_exported_test.go", diff --git a/service/sagemakerruntime/sra_operation_order_test.go b/service/sagemakerruntime/sra_operation_order_test.go new file mode 100644 index 00000000000..8b4ccf98552 --- /dev/null +++ b/service/sagemakerruntime/sra_operation_order_test.go @@ -0,0 +1,126 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sagemakerruntime + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpInvokeEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InvokeEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInvokeEndpointAsyncSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InvokeEndpointAsync(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInvokeEndpointWithResponseStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InvokeEndpointWithResponseStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/savingsplans/generated.json b/service/savingsplans/generated.json index 537e83e6fb8..6c04a7d13c9 100644 --- a/service/savingsplans/generated.json +++ b/service/savingsplans/generated.json @@ -31,6 +31,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/savingsplans/sra_operation_order_test.go b/service/savingsplans/sra_operation_order_test.go new file mode 100644 index 00000000000..defa8f2091f --- /dev/null +++ b/service/savingsplans/sra_operation_order_test.go @@ -0,0 +1,371 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package savingsplans + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateSavingsPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSavingsPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteQueuedSavingsPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteQueuedSavingsPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSavingsPlanRatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSavingsPlanRates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSavingsPlansSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSavingsPlans(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSavingsPlansOfferingRatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSavingsPlansOfferingRates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSavingsPlansOfferingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSavingsPlansOfferings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReturnSavingsPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReturnSavingsPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/scheduler/generated.json b/service/scheduler/generated.json index 5c9897421a5..cb5e54798ab 100644 --- a/service/scheduler/generated.json +++ b/service/scheduler/generated.json @@ -33,6 +33,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/scheduler/sra_operation_order_test.go b/service/scheduler/sra_operation_order_test.go new file mode 100644 index 00000000000..59eff2ec909 --- /dev/null +++ b/service/scheduler/sra_operation_order_test.go @@ -0,0 +1,441 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package scheduler + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateScheduleGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateScheduleGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteScheduleGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteScheduleGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetScheduleGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetScheduleGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListScheduleGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListScheduleGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSchedulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSchedules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/schemas/generated.json b/service/schemas/generated.json index 911fa1c0da7..8d0fb5774cd 100644 --- a/service/schemas/generated.json +++ b/service/schemas/generated.json @@ -52,6 +52,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/schemas/sra_operation_order_test.go b/service/schemas/sra_operation_order_test.go new file mode 100644 index 00000000000..84e43a06b16 --- /dev/null +++ b/service/schemas/sra_operation_order_test.go @@ -0,0 +1,1106 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package schemas + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateDiscovererSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDiscoverer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRegistrySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRegistry(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSchemaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSchema(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDiscovererSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDiscoverer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRegistrySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRegistry(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSchemaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSchema(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSchemaVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSchemaVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCodeBindingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCodeBinding(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDiscovererSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDiscoverer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRegistrySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRegistry(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSchemaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSchema(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportSchemaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportSchema(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCodeBindingSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCodeBindingSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDiscoveredSchemaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDiscoveredSchema(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDiscoverersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDiscoverers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRegistriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRegistries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSchemasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSchemas(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSchemaVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSchemaVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutCodeBindingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutCodeBinding(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchSchemasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchSchemas(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDiscovererSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDiscoverer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopDiscovererSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopDiscoverer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDiscovererSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDiscoverer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRegistrySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRegistry(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSchemaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSchema(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/secretsmanager/generated.json b/service/secretsmanager/generated.json index d0eb0784c1f..de89e16b88f 100644 --- a/service/secretsmanager/generated.json +++ b/service/secretsmanager/generated.json @@ -44,6 +44,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/secretsmanager/sra_operation_order_test.go b/service/secretsmanager/sra_operation_order_test.go new file mode 100644 index 00000000000..3bad56081bc --- /dev/null +++ b/service/secretsmanager/sra_operation_order_test.go @@ -0,0 +1,826 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package secretsmanager + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchGetSecretValueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetSecretValue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelRotateSecretSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelRotateSecret(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSecretSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSecret(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSecretSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSecret(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSecretSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSecret(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRandomPasswordSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRandomPassword(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSecretValueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSecretValue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSecretsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSecrets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSecretVersionIdsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSecretVersionIds(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutSecretValueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutSecretValue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveRegionsFromReplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveRegionsFromReplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReplicateSecretToRegionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReplicateSecretToRegions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreSecretSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreSecret(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRotateSecretSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RotateSecret(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopReplicationToReplicaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopReplicationToReplica(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSecretSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSecret(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSecretVersionStageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSecretVersionStage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpValidateResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ValidateResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/securityhub/generated.json b/service/securityhub/generated.json index b7510f36d98..aba671ab9e6 100644 --- a/service/securityhub/generated.json +++ b/service/securityhub/generated.json @@ -100,6 +100,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/securityhub/sra_operation_order_test.go b/service/securityhub/sra_operation_order_test.go new file mode 100644 index 00000000000..9d856681d9b --- /dev/null +++ b/service/securityhub/sra_operation_order_test.go @@ -0,0 +1,2786 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package securityhub + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcceptAdministratorInvitationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptAdministratorInvitation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAcceptInvitationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptInvitation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDeleteAutomationRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteAutomationRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDisableStandardsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDisableStandards(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchEnableStandardsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchEnableStandards(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetAutomationRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetAutomationRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetConfigurationPolicyAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetConfigurationPolicyAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetSecurityControlsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetSecurityControls(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetStandardsControlAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetStandardsControlAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchImportFindingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchImportFindings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchUpdateAutomationRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchUpdateAutomationRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchUpdateFindingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchUpdateFindings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchUpdateStandardsControlAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchUpdateStandardsControlAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateActionTargetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateActionTarget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAutomationRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAutomationRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConfigurationPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConfigurationPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFindingAggregatorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFindingAggregator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInsightSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInsight(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeclineInvitationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeclineInvitations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteActionTargetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteActionTarget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConfigurationPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConfigurationPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFindingAggregatorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFindingAggregator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInsightSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInsight(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInvitationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInvitations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeActionTargetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeActionTargets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeHubSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeHub(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOrganizationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOrganizationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeProductsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeProducts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStandardsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStandards(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStandardsControlsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStandardsControls(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableImportFindingsForProductSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableImportFindingsForProduct(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableOrganizationAdminAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableOrganizationAdminAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableSecurityHubSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableSecurityHub(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateFromAdministratorAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateFromAdministratorAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateFromMasterAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateFromMasterAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableImportFindingsForProductSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableImportFindingsForProduct(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableOrganizationAdminAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableOrganizationAdminAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableSecurityHubSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableSecurityHub(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAdministratorAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAdministratorAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConfigurationPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConfigurationPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConfigurationPolicyAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConfigurationPolicyAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEnabledStandardsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEnabledStandards(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFindingAggregatorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFindingAggregator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFindingHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFindingHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFindingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFindings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInsightResultsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInsightResults(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInsightsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInsights(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInvitationsCountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInvitationsCount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMasterAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMasterAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSecurityControlDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSecurityControlDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInviteMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InviteMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAutomationRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAutomationRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConfigurationPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConfigurationPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConfigurationPolicyAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConfigurationPolicyAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEnabledProductsForImportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEnabledProductsForImport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFindingAggregatorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFindingAggregators(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInvitationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInvitations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOrganizationAdminAccountsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOrganizationAdminAccounts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSecurityControlDefinitionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSecurityControlDefinitions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStandardsControlAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStandardsControlAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartConfigurationPolicyAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartConfigurationPolicyAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartConfigurationPolicyDisassociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartConfigurationPolicyDisassociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateActionTargetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateActionTarget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConfigurationPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConfigurationPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFindingAggregatorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFindingAggregator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFindingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFindings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateInsightSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateInsight(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateOrganizationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateOrganizationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSecurityControlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSecurityControl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSecurityHubConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSecurityHubConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateStandardsControlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateStandardsControl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/securityir/generated.json b/service/securityir/generated.json index 73345e7cfe3..96c133ceb1d 100644 --- a/service/securityir/generated.json +++ b/service/securityir/generated.json @@ -43,6 +43,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/securityir/sra_operation_order_test.go b/service/securityir/sra_operation_order_test.go new file mode 100644 index 00000000000..c0fa761d219 --- /dev/null +++ b/service/securityir/sra_operation_order_test.go @@ -0,0 +1,791 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package securityir + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchGetMemberAccountDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetMemberAccountDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCloseCaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CloseCase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCaseCommentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCaseComment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCaseAttachmentDownloadUrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCaseAttachmentDownloadUrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCaseAttachmentUploadUrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCaseAttachmentUploadUrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCaseEditsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCaseEdits(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCommentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListComments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMembershipsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMemberships(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCaseCommentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCaseComment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCaseStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCaseStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMembershipSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMembership(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateResolverTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateResolverType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/securitylake/generated.json b/service/securitylake/generated.json index de0c6afc603..96372daf5cc 100644 --- a/service/securitylake/generated.json +++ b/service/securitylake/generated.json @@ -52,6 +52,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/securitylake/sra_operation_order_test.go b/service/securitylake/sra_operation_order_test.go new file mode 100644 index 00000000000..dc295f235e4 --- /dev/null +++ b/service/securitylake/sra_operation_order_test.go @@ -0,0 +1,1106 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package securitylake + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateAwsLogSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAwsLogSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCustomLogSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCustomLogSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataLakeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataLake(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataLakeExceptionSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataLakeExceptionSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataLakeOrganizationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataLakeOrganizationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSubscriberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSubscriber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSubscriberNotificationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSubscriberNotification(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAwsLogSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAwsLogSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCustomLogSourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCustomLogSource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataLakeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataLake(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataLakeExceptionSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataLakeExceptionSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataLakeOrganizationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataLakeOrganizationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSubscriberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSubscriber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSubscriberNotificationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSubscriberNotification(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterDataLakeDelegatedAdministratorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterDataLakeDelegatedAdministrator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataLakeExceptionSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataLakeExceptionSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataLakeOrganizationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataLakeOrganizationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataLakeSourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataLakeSources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSubscriberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSubscriber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataLakeExceptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataLakeExceptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataLakesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataLakes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLogSourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLogSources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSubscribersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSubscribers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterDataLakeDelegatedAdministratorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterDataLakeDelegatedAdministrator(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDataLakeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataLake(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDataLakeExceptionSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataLakeExceptionSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSubscriberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSubscriber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSubscriberNotificationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSubscriberNotification(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/serverlessapplicationrepository/generated.json b/service/serverlessapplicationrepository/generated.json index 1adc0e7c2b1..ba09f684347 100644 --- a/service/serverlessapplicationrepository/generated.json +++ b/service/serverlessapplicationrepository/generated.json @@ -35,6 +35,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/serverlessapplicationrepository/sra_operation_order_test.go b/service/serverlessapplicationrepository/sra_operation_order_test.go new file mode 100644 index 00000000000..d03849acc37 --- /dev/null +++ b/service/serverlessapplicationrepository/sra_operation_order_test.go @@ -0,0 +1,511 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package serverlessapplicationrepository + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateApplicationVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApplicationVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCloudFormationChangeSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCloudFormationChangeSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCloudFormationTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCloudFormationTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApplicationPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApplicationPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCloudFormationTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCloudFormationTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationDependenciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplicationDependencies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplicationVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutApplicationPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutApplicationPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUnshareApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UnshareApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/servicecatalog/generated.json b/service/servicecatalog/generated.json index 95f449c0748..145e42a47ed 100644 --- a/service/servicecatalog/generated.json +++ b/service/servicecatalog/generated.json @@ -111,6 +111,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/servicecatalog/sra_operation_order_test.go b/service/servicecatalog/sra_operation_order_test.go new file mode 100644 index 00000000000..59d8f3f3c05 --- /dev/null +++ b/service/servicecatalog/sra_operation_order_test.go @@ -0,0 +1,3171 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package servicecatalog + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcceptPortfolioShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptPortfolioShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateBudgetWithResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateBudgetWithResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociatePrincipalWithPortfolioSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociatePrincipalWithPortfolio(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateProductWithPortfolioSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateProductWithPortfolio(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateServiceActionWithProvisioningArtifactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateServiceActionWithProvisioningArtifact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateTagOptionWithResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateTagOptionWithResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchAssociateServiceActionWithProvisioningArtifactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchAssociateServiceActionWithProvisioningArtifact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchDisassociateServiceActionFromProvisioningArtifactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDisassociateServiceActionFromProvisioningArtifact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCopyProductSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopyProduct(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConstraintSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConstraint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePortfolioSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePortfolio(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePortfolioShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePortfolioShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProductSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProduct(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProvisionedProductPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProvisionedProductPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProvisioningArtifactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProvisioningArtifact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateServiceActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateServiceAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTagOptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTagOption(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConstraintSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConstraint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePortfolioSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePortfolio(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePortfolioShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePortfolioShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProductSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProduct(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProvisionedProductPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProvisionedProductPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProvisioningArtifactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProvisioningArtifact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteServiceActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteServiceAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTagOptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTagOption(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConstraintSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConstraint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCopyProductStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCopyProductStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePortfolioSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePortfolio(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePortfolioSharesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePortfolioShares(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePortfolioShareStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePortfolioShareStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeProductSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeProduct(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeProductAsAdminSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeProductAsAdmin(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeProductViewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeProductView(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeProvisionedProductSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeProvisionedProduct(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeProvisionedProductPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeProvisionedProductPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeProvisioningArtifactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeProvisioningArtifact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeProvisioningParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeProvisioningParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRecordSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRecord(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeServiceActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeServiceAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeServiceActionExecutionParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeServiceActionExecutionParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTagOptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTagOption(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableAWSOrganizationsAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableAWSOrganizationsAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateBudgetFromResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateBudgetFromResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociatePrincipalFromPortfolioSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociatePrincipalFromPortfolio(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateProductFromPortfolioSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateProductFromPortfolio(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateServiceActionFromProvisioningArtifactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateServiceActionFromProvisioningArtifact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateTagOptionFromResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateTagOptionFromResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableAWSOrganizationsAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableAWSOrganizationsAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExecuteProvisionedProductPlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExecuteProvisionedProductPlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExecuteProvisionedProductServiceActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExecuteProvisionedProductServiceAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAWSOrganizationsAccessStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAWSOrganizationsAccessStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetProvisionedProductOutputsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetProvisionedProductOutputs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportAsProvisionedProductSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportAsProvisionedProduct(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAcceptedPortfolioSharesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAcceptedPortfolioShares(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBudgetsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBudgetsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConstraintsForPortfolioSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConstraintsForPortfolio(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLaunchPathsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLaunchPaths(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOrganizationPortfolioAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOrganizationPortfolioAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPortfolioAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPortfolioAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPortfoliosSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPortfolios(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPortfoliosForProductSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPortfoliosForProduct(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPrincipalsForPortfolioSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPrincipalsForPortfolio(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProvisionedProductPlansSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProvisionedProductPlans(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProvisioningArtifactsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProvisioningArtifacts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProvisioningArtifactsForServiceActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProvisioningArtifactsForServiceAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRecordHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRecordHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourcesForTagOptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourcesForTagOption(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServiceActionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServiceActions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServiceActionsForProvisioningArtifactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServiceActionsForProvisioningArtifact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStackInstancesForProvisionedProductSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStackInstancesForProvisionedProduct(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNotifyProvisionProductEngineWorkflowResultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NotifyProvisionProductEngineWorkflowResult(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNotifyTerminateProvisionedProductEngineWorkflowResultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NotifyTerminateProvisionedProductEngineWorkflowResult(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNotifyUpdateProvisionedProductEngineWorkflowResultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NotifyUpdateProvisionedProductEngineWorkflowResult(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpProvisionProductSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ProvisionProduct(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRejectPortfolioShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RejectPortfolioShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpScanProvisionedProductsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ScanProvisionedProducts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchProductsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchProducts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchProductsAsAdminSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchProductsAsAdmin(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchProvisionedProductsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchProvisionedProducts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTerminateProvisionedProductSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TerminateProvisionedProduct(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConstraintSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConstraint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePortfolioSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePortfolio(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePortfolioShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePortfolioShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProductSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProduct(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProvisionedProductSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProvisionedProduct(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProvisionedProductPropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProvisionedProductProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProvisioningArtifactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProvisioningArtifact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateServiceActionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateServiceAction(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTagOptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTagOption(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/servicecatalogappregistry/generated.json b/service/servicecatalogappregistry/generated.json index a27baa363d8..4c0b0aa74da 100644 --- a/service/servicecatalogappregistry/generated.json +++ b/service/servicecatalogappregistry/generated.json @@ -45,6 +45,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/servicecatalogappregistry/sra_operation_order_test.go b/service/servicecatalogappregistry/sra_operation_order_test.go new file mode 100644 index 00000000000..ec4a5316651 --- /dev/null +++ b/service/servicecatalogappregistry/sra_operation_order_test.go @@ -0,0 +1,861 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package servicecatalogappregistry + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateAttributeGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateAttributeGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAttributeGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAttributeGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAttributeGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAttributeGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateAttributeGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateAttributeGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAssociatedResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAssociatedResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAttributeGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAttributeGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssociatedAttributeGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssociatedAttributeGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssociatedResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssociatedResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAttributeGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAttributeGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAttributeGroupsForApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAttributeGroupsForApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSyncResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SyncResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAttributeGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAttributeGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/servicediscovery/generated.json b/service/servicediscovery/generated.json index 51e8c151c4b..afbae0408c5 100644 --- a/service/servicediscovery/generated.json +++ b/service/servicediscovery/generated.json @@ -51,6 +51,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/servicediscovery/sra_operation_order_test.go b/service/servicediscovery/sra_operation_order_test.go new file mode 100644 index 00000000000..e4111c27461 --- /dev/null +++ b/service/servicediscovery/sra_operation_order_test.go @@ -0,0 +1,1071 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package servicediscovery + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateHttpNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateHttpNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePrivateDnsNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePrivateDnsNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePublicDnsNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePublicDnsNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteServiceAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteServiceAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDiscoverInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DiscoverInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDiscoverInstancesRevisionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DiscoverInstancesRevision(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInstancesHealthStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInstancesHealthStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServiceAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNamespacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNamespaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOperationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOperations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateHttpNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateHttpNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateInstanceCustomHealthStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateInstanceCustomHealthStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePrivateDnsNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePrivateDnsNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePublicDnsNamespaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePublicDnsNamespace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateServiceAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateServiceAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/servicequotas/generated.json b/service/servicequotas/generated.json index de3937fee81..4ea150bf228 100644 --- a/service/servicequotas/generated.json +++ b/service/servicequotas/generated.json @@ -40,6 +40,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/servicequotas/sra_operation_order_test.go b/service/servicequotas/sra_operation_order_test.go new file mode 100644 index 00000000000..813d36985f6 --- /dev/null +++ b/service/servicequotas/sra_operation_order_test.go @@ -0,0 +1,686 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package servicequotas + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateServiceQuotaTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateServiceQuotaTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteServiceQuotaIncreaseRequestFromTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteServiceQuotaIncreaseRequestFromTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateServiceQuotaTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateServiceQuotaTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAssociationForServiceQuotaTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAssociationForServiceQuotaTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAWSDefaultServiceQuotaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAWSDefaultServiceQuota(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRequestedServiceQuotaChangeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRequestedServiceQuotaChange(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceQuotaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServiceQuota(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceQuotaIncreaseRequestFromTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServiceQuotaIncreaseRequestFromTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAWSDefaultServiceQuotasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAWSDefaultServiceQuotas(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRequestedServiceQuotaChangeHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRequestedServiceQuotaChangeHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRequestedServiceQuotaChangeHistoryByQuotaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRequestedServiceQuotaChangeHistoryByQuota(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServiceQuotaIncreaseRequestsInTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServiceQuotaIncreaseRequestsInTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServiceQuotasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServiceQuotas(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutServiceQuotaIncreaseRequestIntoTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutServiceQuotaIncreaseRequestIntoTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRequestServiceQuotaIncreaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RequestServiceQuotaIncrease(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/ses/generated.json b/service/ses/generated.json index 6219eb7a3c1..c2b9aa97389 100644 --- a/service/ses/generated.json +++ b/service/ses/generated.json @@ -92,6 +92,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/ses/sra_operation_order_test.go b/service/ses/sra_operation_order_test.go new file mode 100644 index 00000000000..8c3dc21e373 --- /dev/null +++ b/service/ses/sra_operation_order_test.go @@ -0,0 +1,2506 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ses + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCloneReceiptRuleSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CloneReceiptRuleSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConfigurationSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConfigurationSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConfigurationSetEventDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConfigurationSetEventDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConfigurationSetTrackingOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConfigurationSetTrackingOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCustomVerificationEmailTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCustomVerificationEmailTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateReceiptFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateReceiptFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateReceiptRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateReceiptRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateReceiptRuleSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateReceiptRuleSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConfigurationSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConfigurationSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConfigurationSetEventDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConfigurationSetEventDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConfigurationSetTrackingOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConfigurationSetTrackingOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCustomVerificationEmailTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCustomVerificationEmailTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIdentitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIdentity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIdentityPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIdentityPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteReceiptFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteReceiptFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteReceiptRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteReceiptRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteReceiptRuleSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteReceiptRuleSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVerifiedEmailAddressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVerifiedEmailAddress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeActiveReceiptRuleSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeActiveReceiptRuleSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConfigurationSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConfigurationSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReceiptRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReceiptRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReceiptRuleSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReceiptRuleSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccountSendingEnabledSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccountSendingEnabled(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCustomVerificationEmailTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCustomVerificationEmailTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIdentityDkimAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIdentityDkimAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIdentityMailFromDomainAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIdentityMailFromDomainAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIdentityNotificationAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIdentityNotificationAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIdentityPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIdentityPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIdentityVerificationAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIdentityVerificationAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSendQuotaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSendQuota(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSendStatisticsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSendStatistics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConfigurationSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConfigurationSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCustomVerificationEmailTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCustomVerificationEmailTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIdentitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIdentities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIdentityPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIdentityPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReceiptFiltersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReceiptFilters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReceiptRuleSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReceiptRuleSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVerifiedEmailAddressesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVerifiedEmailAddresses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutConfigurationSetDeliveryOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutConfigurationSetDeliveryOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutIdentityPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutIdentityPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReorderReceiptRuleSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReorderReceiptRuleSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendBounceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendBounce(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendBulkTemplatedEmailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendBulkTemplatedEmail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendCustomVerificationEmailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendCustomVerificationEmail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendEmailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendEmail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendRawEmailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendRawEmail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendTemplatedEmailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendTemplatedEmail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetActiveReceiptRuleSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetActiveReceiptRuleSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetIdentityDkimEnabledSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetIdentityDkimEnabled(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetIdentityFeedbackForwardingEnabledSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetIdentityFeedbackForwardingEnabled(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetIdentityHeadersInNotificationsEnabledSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetIdentityHeadersInNotificationsEnabled(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetIdentityMailFromDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetIdentityMailFromDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetIdentityNotificationTopicSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetIdentityNotificationTopic(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetReceiptRulePositionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetReceiptRulePosition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestRenderTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestRenderTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAccountSendingEnabledSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAccountSendingEnabled(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConfigurationSetEventDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConfigurationSetEventDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConfigurationSetReputationMetricsEnabledSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConfigurationSetReputationMetricsEnabled(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConfigurationSetSendingEnabledSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConfigurationSetSendingEnabled(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConfigurationSetTrackingOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConfigurationSetTrackingOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCustomVerificationEmailTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCustomVerificationEmailTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateReceiptRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateReceiptRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpVerifyDomainDkimSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.VerifyDomainDkim(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpVerifyDomainIdentitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.VerifyDomainIdentity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpVerifyEmailAddressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.VerifyEmailAddress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpVerifyEmailIdentitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.VerifyEmailIdentity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/sesv2/generated.json b/service/sesv2/generated.json index 00a18f99b40..0e85c6e94af 100644 --- a/service/sesv2/generated.json +++ b/service/sesv2/generated.json @@ -119,6 +119,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/sesv2/sra_operation_order_test.go b/service/sesv2/sra_operation_order_test.go new file mode 100644 index 00000000000..013f35fc5ea --- /dev/null +++ b/service/sesv2/sra_operation_order_test.go @@ -0,0 +1,3416 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sesv2 + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchGetMetricDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetMetricData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConfigurationSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConfigurationSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConfigurationSetEventDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConfigurationSetEventDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateContactListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateContactList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCustomVerificationEmailTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCustomVerificationEmailTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDedicatedIpPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDedicatedIpPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDeliverabilityTestReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDeliverabilityTestReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEmailIdentitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEmailIdentity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEmailIdentityPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEmailIdentityPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateEmailTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEmailTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMultiRegionEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMultiRegionEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConfigurationSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConfigurationSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConfigurationSetEventDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConfigurationSetEventDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteContactListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteContactList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCustomVerificationEmailTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCustomVerificationEmailTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDedicatedIpPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDedicatedIpPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEmailIdentitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEmailIdentity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEmailIdentityPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEmailIdentityPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEmailTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEmailTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMultiRegionEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMultiRegionEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSuppressedDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSuppressedDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBlacklistReportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBlacklistReports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConfigurationSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConfigurationSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConfigurationSetEventDestinationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConfigurationSetEventDestinations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetContactListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetContactList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCustomVerificationEmailTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCustomVerificationEmailTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDedicatedIpSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDedicatedIp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDedicatedIpPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDedicatedIpPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDedicatedIpsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDedicatedIps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeliverabilityDashboardOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeliverabilityDashboardOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeliverabilityTestReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeliverabilityTestReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDomainDeliverabilityCampaignSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDomainDeliverabilityCampaign(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDomainStatisticsReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDomainStatisticsReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEmailIdentitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEmailIdentity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEmailIdentityPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEmailIdentityPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEmailTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEmailTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMessageInsightsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMessageInsights(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMultiRegionEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMultiRegionEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSuppressedDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSuppressedDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConfigurationSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConfigurationSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListContactListsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListContactLists(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListContactsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListContacts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCustomVerificationEmailTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCustomVerificationEmailTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDedicatedIpPoolsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDedicatedIpPools(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDeliverabilityTestReportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDeliverabilityTestReports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDomainDeliverabilityCampaignsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDomainDeliverabilityCampaigns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEmailIdentitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEmailIdentities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEmailTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEmailTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListExportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListExportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListImportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListImportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMultiRegionEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMultiRegionEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSuppressedDestinationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSuppressedDestinations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAccountDedicatedIpWarmupAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAccountDedicatedIpWarmupAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAccountDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAccountDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAccountSendingAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAccountSendingAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAccountSuppressionAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAccountSuppressionAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAccountVdmAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAccountVdmAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutConfigurationSetArchivingOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutConfigurationSetArchivingOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutConfigurationSetDeliveryOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutConfigurationSetDeliveryOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutConfigurationSetReputationOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutConfigurationSetReputationOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutConfigurationSetSendingOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutConfigurationSetSendingOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutConfigurationSetSuppressionOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutConfigurationSetSuppressionOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutConfigurationSetTrackingOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutConfigurationSetTrackingOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutConfigurationSetVdmOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutConfigurationSetVdmOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutDedicatedIpInPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutDedicatedIpInPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutDedicatedIpPoolScalingAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutDedicatedIpPoolScalingAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutDedicatedIpWarmupAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutDedicatedIpWarmupAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutDeliverabilityDashboardOptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutDeliverabilityDashboardOption(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutEmailIdentityConfigurationSetAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutEmailIdentityConfigurationSetAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutEmailIdentityDkimAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutEmailIdentityDkimAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutEmailIdentityDkimSigningAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutEmailIdentityDkimSigningAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutEmailIdentityFeedbackAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutEmailIdentityFeedbackAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutEmailIdentityMailFromAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutEmailIdentityMailFromAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutSuppressedDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutSuppressedDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendBulkEmailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendBulkEmail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendCustomVerificationEmailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendCustomVerificationEmail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendEmailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendEmail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestRenderEmailTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestRenderEmailTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConfigurationSetEventDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConfigurationSetEventDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateContactListSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateContactList(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCustomVerificationEmailTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCustomVerificationEmailTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEmailIdentityPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEmailIdentityPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEmailTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEmailTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/sfn/generated.json b/service/sfn/generated.json index b1723e18eda..6c85300efae 100644 --- a/service/sfn/generated.json +++ b/service/sfn/generated.json @@ -58,6 +58,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/sfn/sra_operation_order_test.go b/service/sfn/sra_operation_order_test.go new file mode 100644 index 00000000000..5db0066e6af --- /dev/null +++ b/service/sfn/sra_operation_order_test.go @@ -0,0 +1,1316 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sfn + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateActivitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateActivity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStateMachineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStateMachine(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStateMachineAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStateMachineAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteActivitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteActivity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteStateMachineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteStateMachine(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteStateMachineAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteStateMachineAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteStateMachineVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteStateMachineVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeActivitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeActivity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMapRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMapRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStateMachineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStateMachine(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStateMachineAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStateMachineAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStateMachineForExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStateMachineForExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetActivityTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetActivityTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetExecutionHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetExecutionHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListActivitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListActivities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMapRunsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMapRuns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStateMachineAliasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStateMachineAliases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStateMachinesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStateMachines(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListStateMachineVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListStateMachineVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPublishStateMachineVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PublishStateMachineVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRedriveExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RedriveExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendTaskFailureSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendTaskFailure(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendTaskHeartbeatSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendTaskHeartbeat(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendTaskSuccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendTaskSuccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartSyncExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartSyncExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestStateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestState(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMapRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMapRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateStateMachineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateStateMachine(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateStateMachineAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateStateMachineAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpValidateStateMachineDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ValidateStateMachineDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/shield/generated.json b/service/shield/generated.json index b0273dbe04d..be2246fc651 100644 --- a/service/shield/generated.json +++ b/service/shield/generated.json @@ -57,6 +57,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/shield/sra_operation_order_test.go b/service/shield/sra_operation_order_test.go new file mode 100644 index 00000000000..f3f44be1459 --- /dev/null +++ b/service/shield/sra_operation_order_test.go @@ -0,0 +1,1281 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package shield + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateDRTLogBucketSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateDRTLogBucket(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateDRTRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateDRTRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateHealthCheckSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateHealthCheck(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateProactiveEngagementDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateProactiveEngagementDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProtectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProtection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProtectionGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProtectionGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProtectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProtection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProtectionGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProtectionGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAttackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAttack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAttackStatisticsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAttackStatistics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDRTAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDRTAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEmergencyContactSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEmergencyContactSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeProtectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeProtection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeProtectionGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeProtectionGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableApplicationLayerAutomaticResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableApplicationLayerAutomaticResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableProactiveEngagementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableProactiveEngagement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateDRTLogBucketSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateDRTLogBucket(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateDRTRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateDRTRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateHealthCheckSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateHealthCheck(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableApplicationLayerAutomaticResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableApplicationLayerAutomaticResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEnableProactiveEngagementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EnableProactiveEngagement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSubscriptionStateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSubscriptionState(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAttacksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAttacks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProtectionGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProtectionGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProtectionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProtections(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourcesInProtectionGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourcesInProtectionGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApplicationLayerAutomaticResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApplicationLayerAutomaticResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEmergencyContactSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEmergencyContactSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProtectionGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProtectionGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/signer/generated.json b/service/signer/generated.json index 846abb42a6e..d15127f2c44 100644 --- a/service/signer/generated.json +++ b/service/signer/generated.json @@ -40,6 +40,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/signer/sra_operation_order_test.go b/service/signer/sra_operation_order_test.go new file mode 100644 index 00000000000..1752ad84422 --- /dev/null +++ b/service/signer/sra_operation_order_test.go @@ -0,0 +1,686 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package signer + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddProfilePermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddProfilePermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelSigningProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelSigningProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSigningJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSigningJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRevocationStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRevocationStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSigningPlatformSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSigningPlatform(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSigningProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSigningProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProfilePermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProfilePermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSigningJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSigningJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSigningPlatformsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSigningPlatforms(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSigningProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSigningProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutSigningProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutSigningProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveProfilePermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveProfilePermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRevokeSignatureSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RevokeSignature(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRevokeSigningProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RevokeSigningProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSignPayloadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SignPayload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartSigningJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartSigningJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/simspaceweaver/generated.json b/service/simspaceweaver/generated.json index bd5a06ff75b..7eb5ce6872f 100644 --- a/service/simspaceweaver/generated.json +++ b/service/simspaceweaver/generated.json @@ -37,6 +37,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/simspaceweaver/sra_operation_order_test.go b/service/simspaceweaver/sra_operation_order_test.go new file mode 100644 index 00000000000..17b5c523b78 --- /dev/null +++ b/service/simspaceweaver/sra_operation_order_test.go @@ -0,0 +1,581 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package simspaceweaver + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSimulationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSimulation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSimulationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSimulation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAppsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSimulationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSimulations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartClockSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartClock(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartSimulationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartSimulation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopClockSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopClock(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopSimulationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopSimulation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/sms/generated.json b/service/sms/generated.json index 4ea48fb2a86..49a4eaded7d 100644 --- a/service/sms/generated.json +++ b/service/sms/generated.json @@ -56,6 +56,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/sms/sra_operation_order_test.go b/service/sms/sra_operation_order_test.go new file mode 100644 index 00000000000..f2cbb16df94 --- /dev/null +++ b/service/sms/sra_operation_order_test.go @@ -0,0 +1,1246 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sms + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateReplicationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateReplicationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAppLaunchConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAppLaunchConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAppReplicationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAppReplicationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAppValidationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAppValidationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteReplicationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteReplicationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteServerCatalogSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteServerCatalog(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGenerateChangeSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GenerateChangeSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGenerateTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GenerateTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAppLaunchConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAppLaunchConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAppReplicationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAppReplicationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAppValidationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAppValidationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAppValidationOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAppValidationOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConnectorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConnectors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReplicationJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReplicationJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReplicationRunsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReplicationRuns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportAppCatalogSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportAppCatalog(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportServerCatalogSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportServerCatalog(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpLaunchAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.LaunchApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAppsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNotifyAppValidationOutputSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NotifyAppValidationOutput(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAppLaunchConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAppLaunchConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAppReplicationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAppReplicationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAppValidationConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAppValidationConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartAppReplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartAppReplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartOnDemandAppReplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartOnDemandAppReplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartOnDemandReplicationRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartOnDemandReplicationRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopAppReplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopAppReplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTerminateAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TerminateApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateReplicationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateReplicationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/snowball/generated.json b/service/snowball/generated.json index f4826e6c525..070f9bc2d4c 100644 --- a/service/snowball/generated.json +++ b/service/snowball/generated.json @@ -48,6 +48,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/snowball/sra_operation_order_test.go b/service/snowball/sra_operation_order_test.go new file mode 100644 index 00000000000..ebb3fb99101 --- /dev/null +++ b/service/snowball/sra_operation_order_test.go @@ -0,0 +1,966 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package snowball + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCancelClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAddressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAddress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLongTermPricingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLongTermPricing(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateReturnShippingLabelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateReturnShippingLabel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAddressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAddress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAddressesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAddresses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeReturnShippingLabelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeReturnShippingLabel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetJobManifestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetJobManifest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetJobUnlockCodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetJobUnlockCode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSnowballUsageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSnowballUsage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSoftwareUpdatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSoftwareUpdates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListClusterJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListClusterJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCompatibleImagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCompatibleImages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLongTermPricingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLongTermPricing(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPickupLocationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPickupLocations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServiceVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServiceVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateJobShipmentStateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateJobShipmentState(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLongTermPricingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLongTermPricing(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/snowdevicemanagement/generated.json b/service/snowdevicemanagement/generated.json index 0ec89605cd4..678a329f373 100644 --- a/service/snowdevicemanagement/generated.json +++ b/service/snowdevicemanagement/generated.json @@ -34,6 +34,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/snowdevicemanagement/sra_operation_order_test.go b/service/snowdevicemanagement/sra_operation_order_test.go new file mode 100644 index 00000000000..f71fa357760 --- /dev/null +++ b/service/snowdevicemanagement/sra_operation_order_test.go @@ -0,0 +1,476 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package snowdevicemanagement + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCancelTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDeviceEc2InstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDeviceEc2Instances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDeviceResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDeviceResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDevicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDevices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/sns/generated.json b/service/sns/generated.json index 3c753a4c9a4..a0241a2bdd1 100644 --- a/service/sns/generated.json +++ b/service/sns/generated.json @@ -63,6 +63,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/sns/sra_operation_order_test.go b/service/sns/sra_operation_order_test.go new file mode 100644 index 00000000000..bbe3f08ee34 --- /dev/null +++ b/service/sns/sra_operation_order_test.go @@ -0,0 +1,1491 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sns + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddPermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddPermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCheckIfPhoneNumberIsOptedOutSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CheckIfPhoneNumberIsOptedOut(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpConfirmSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ConfirmSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePlatformApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePlatformApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePlatformEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePlatformEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSMSSandboxPhoneNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSMSSandboxPhoneNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTopicSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTopic(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEndpointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEndpoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePlatformApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePlatformApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSMSSandboxPhoneNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSMSSandboxPhoneNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTopicSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTopic(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataProtectionPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataProtectionPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEndpointAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEndpointAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPlatformApplicationAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPlatformApplicationAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSMSAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSMSAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSMSSandboxAccountStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSMSSandboxAccountStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSubscriptionAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSubscriptionAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTopicAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTopicAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEndpointsByPlatformApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEndpointsByPlatformApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOriginationNumbersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOriginationNumbers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPhoneNumbersOptedOutSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPhoneNumbersOptedOut(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPlatformApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPlatformApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSMSSandboxPhoneNumbersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSMSSandboxPhoneNumbers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSubscriptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSubscriptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSubscriptionsByTopicSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSubscriptionsByTopic(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTopicsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTopics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpOptInPhoneNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.OptInPhoneNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPublishSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Publish(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPublishBatchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PublishBatch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutDataProtectionPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutDataProtectionPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemovePermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemovePermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetEndpointAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetEndpointAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetPlatformApplicationAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetPlatformApplicationAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetSMSAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetSMSAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetSubscriptionAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetSubscriptionAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetTopicAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetTopicAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSubscribeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Subscribe(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUnsubscribeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Unsubscribe(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpVerifySMSSandboxPhoneNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.VerifySMSSandboxPhoneNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/socialmessaging/generated.json b/service/socialmessaging/generated.json index 6e7b29408be..ca9b0d403a0 100644 --- a/service/socialmessaging/generated.json +++ b/service/socialmessaging/generated.json @@ -34,6 +34,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/socialmessaging/sra_operation_order_test.go b/service/socialmessaging/sra_operation_order_test.go new file mode 100644 index 00000000000..66399b2b447 --- /dev/null +++ b/service/socialmessaging/sra_operation_order_test.go @@ -0,0 +1,476 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package socialmessaging + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateWhatsAppBusinessAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateWhatsAppBusinessAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWhatsAppMessageMediaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWhatsAppMessageMedia(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateWhatsAppBusinessAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateWhatsAppBusinessAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLinkedWhatsAppBusinessAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLinkedWhatsAppBusinessAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLinkedWhatsAppBusinessAccountPhoneNumberSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLinkedWhatsAppBusinessAccountPhoneNumber(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWhatsAppMessageMediaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWhatsAppMessageMedia(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLinkedWhatsAppBusinessAccountsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLinkedWhatsAppBusinessAccounts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPostWhatsAppMessageMediaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PostWhatsAppMessageMedia(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutWhatsAppBusinessAccountEventDestinationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutWhatsAppBusinessAccountEventDestinations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendWhatsAppMessageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendWhatsAppMessage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/sqs/generated.json b/service/sqs/generated.json index ee973dbbc57..b0e121eba00 100644 --- a/service/sqs/generated.json +++ b/service/sqs/generated.json @@ -44,6 +44,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/sqs/sra_operation_order_test.go b/service/sqs/sra_operation_order_test.go new file mode 100644 index 00000000000..e506a791309 --- /dev/null +++ b/service/sqs/sra_operation_order_test.go @@ -0,0 +1,826 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sqs + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddPermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddPermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelMessageMoveTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelMessageMoveTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpChangeMessageVisibilitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ChangeMessageVisibility(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpChangeMessageVisibilityBatchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ChangeMessageVisibilityBatch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMessageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMessage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMessageBatchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMessageBatch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQueueAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQueueAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQueueUrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQueueUrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDeadLetterSourceQueuesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDeadLetterSourceQueues(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMessageMoveTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMessageMoveTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListQueuesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListQueues(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListQueueTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListQueueTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPurgeQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PurgeQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpReceiveMessageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ReceiveMessage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemovePermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemovePermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendMessageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendMessage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendMessageBatchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendMessageBatch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetQueueAttributesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetQueueAttributes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMessageMoveTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMessageMoveTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagQueueSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagQueue(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/ssm/generated.json b/service/ssm/generated.json index 9e6b3d11bc7..c6d20cb8ecd 100644 --- a/service/ssm/generated.json +++ b/service/ssm/generated.json @@ -165,6 +165,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/ssm/sra_operation_order_test.go b/service/ssm/sra_operation_order_test.go new file mode 100644 index 00000000000..3e99cf28d13 --- /dev/null +++ b/service/ssm/sra_operation_order_test.go @@ -0,0 +1,5061 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssm + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddTagsToResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddTagsToResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateOpsItemRelatedItemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateOpsItemRelatedItem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelCommandSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelCommand(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelMaintenanceWindowExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelMaintenanceWindowExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateActivationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateActivation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAssociationBatchSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAssociationBatch(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDocumentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDocument(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMaintenanceWindowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMaintenanceWindow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateOpsItemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateOpsItem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateOpsMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateOpsMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePatchBaselineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePatchBaseline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateResourceDataSyncSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateResourceDataSync(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteActivationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteActivation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDocumentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDocument(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInventorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInventory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMaintenanceWindowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMaintenanceWindow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteOpsItemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteOpsItem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteOpsMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteOpsMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteParameterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteParameter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePatchBaselineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePatchBaseline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourceDataSyncSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourceDataSync(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterManagedInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterManagedInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterPatchBaselineForPatchGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterPatchBaselineForPatchGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterTargetFromMaintenanceWindowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterTargetFromMaintenanceWindow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterTaskFromMaintenanceWindowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterTaskFromMaintenanceWindow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeActivationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeActivations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAssociationExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAssociationExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAssociationExecutionTargetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAssociationExecutionTargets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAutomationExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAutomationExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAutomationStepExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAutomationStepExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAvailablePatchesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAvailablePatches(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDocumentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDocument(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDocumentPermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDocumentPermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEffectiveInstanceAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEffectiveInstanceAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEffectivePatchesForPatchBaselineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEffectivePatchesForPatchBaseline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInstanceAssociationsStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInstanceAssociationsStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInstanceInformationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInstanceInformation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInstancePatchesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInstancePatches(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInstancePatchStatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInstancePatchStates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInstancePatchStatesForPatchGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInstancePatchStatesForPatchGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInstancePropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInstanceProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInventoryDeletionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInventoryDeletions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMaintenanceWindowExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMaintenanceWindowExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMaintenanceWindowExecutionTaskInvocationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMaintenanceWindowExecutionTaskInvocations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMaintenanceWindowExecutionTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMaintenanceWindowExecutionTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMaintenanceWindowsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMaintenanceWindows(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMaintenanceWindowScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMaintenanceWindowSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMaintenanceWindowsForTargetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMaintenanceWindowsForTarget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMaintenanceWindowTargetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMaintenanceWindowTargets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMaintenanceWindowTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMaintenanceWindowTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOpsItemsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOpsItems(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePatchBaselinesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePatchBaselines(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePatchGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePatchGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePatchGroupStateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePatchGroupState(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePatchPropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePatchProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSessionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSessions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateOpsItemRelatedItemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateOpsItemRelatedItem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAutomationExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAutomationExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCalendarStateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCalendarState(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCommandInvocationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCommandInvocation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConnectionStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConnectionStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDefaultPatchBaselineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDefaultPatchBaseline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeployablePatchSnapshotForInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDeployablePatchSnapshotForInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDocumentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDocument(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetExecutionPreviewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetExecutionPreview(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInventorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInventory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInventorySchemaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInventorySchema(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMaintenanceWindowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMaintenanceWindow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMaintenanceWindowExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMaintenanceWindowExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMaintenanceWindowExecutionTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMaintenanceWindowExecutionTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMaintenanceWindowExecutionTaskInvocationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMaintenanceWindowExecutionTaskInvocation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMaintenanceWindowTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMaintenanceWindowTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOpsItemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOpsItem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOpsMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOpsMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOpsSummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOpsSummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetParameterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetParameter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetParameterHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetParameterHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetParametersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetParameters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetParametersByPathSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetParametersByPath(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPatchBaselineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPatchBaseline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPatchBaselineForPatchGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPatchBaselineForPatchGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourcePoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourcePolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceSettingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServiceSetting(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpLabelParameterVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.LabelParameterVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssociationVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssociationVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCommandInvocationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCommandInvocations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCommandsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCommands(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListComplianceItemsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListComplianceItems(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListComplianceSummariesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListComplianceSummaries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDocumentMetadataHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDocumentMetadataHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDocumentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDocuments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDocumentVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDocumentVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInventoryEntriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInventoryEntries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNodesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNodes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNodesSummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNodesSummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOpsItemEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOpsItemEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOpsItemRelatedItemsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOpsItemRelatedItems(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOpsMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOpsMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceComplianceSummariesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceComplianceSummaries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceDataSyncSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceDataSync(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyDocumentPermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyDocumentPermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutComplianceItemsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutComplianceItems(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutInventorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutInventory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutParameterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutParameter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterDefaultPatchBaselineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterDefaultPatchBaseline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterPatchBaselineForPatchGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterPatchBaselineForPatchGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterTargetWithMaintenanceWindowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterTargetWithMaintenanceWindow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterTaskWithMaintenanceWindowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterTaskWithMaintenanceWindow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveTagsFromResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveTagsFromResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetServiceSettingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetServiceSetting(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResumeSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResumeSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendAutomationSignalSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendAutomationSignal(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendCommandSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendCommand(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartAssociationsOnceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartAssociationsOnce(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartAutomationExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartAutomationExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartChangeRequestExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartChangeRequestExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartExecutionPreviewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartExecutionPreview(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopAutomationExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopAutomationExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTerminateSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TerminateSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUnlabelParameterVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UnlabelParameterVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAssociationStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAssociationStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDocumentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDocument(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDocumentDefaultVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDocumentDefaultVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDocumentMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDocumentMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMaintenanceWindowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMaintenanceWindow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMaintenanceWindowTargetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMaintenanceWindowTarget(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMaintenanceWindowTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMaintenanceWindowTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateManagedInstanceRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateManagedInstanceRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateOpsItemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateOpsItem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateOpsMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateOpsMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePatchBaselineSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePatchBaseline(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateResourceDataSyncSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateResourceDataSync(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateServiceSettingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateServiceSetting(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/ssmcontacts/generated.json b/service/ssmcontacts/generated.json index 2072ebbc7a1..59b6bfda3f9 100644 --- a/service/ssmcontacts/generated.json +++ b/service/ssmcontacts/generated.json @@ -60,6 +60,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/ssmcontacts/sra_operation_order_test.go b/service/ssmcontacts/sra_operation_order_test.go new file mode 100644 index 00000000000..e2a0333711e --- /dev/null +++ b/service/ssmcontacts/sra_operation_order_test.go @@ -0,0 +1,1386 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmcontacts + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcceptPageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptPage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpActivateContactChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ActivateContactChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateContactChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateContactChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRotationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRotation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRotationOverrideSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRotationOverride(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeactivateContactChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeactivateContactChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteContactChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteContactChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRotationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRotation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRotationOverrideSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRotationOverride(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEngagementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEngagement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetContactChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetContactChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetContactPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetContactPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRotationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRotation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRotationOverrideSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRotationOverride(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListContactChannelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListContactChannels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListContactsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListContacts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEngagementsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEngagements(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPageReceiptsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPageReceipts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPageResolutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPageResolutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPagesByContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPagesByContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPagesByEngagementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPagesByEngagement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPreviewRotationShiftsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPreviewRotationShifts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRotationOverridesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRotationOverrides(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRotationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRotations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRotationShiftsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRotationShifts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutContactPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutContactPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendActivationCodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendActivationCode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartEngagementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartEngagement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopEngagementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopEngagement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateContactSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateContact(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateContactChannelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateContactChannel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRotationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRotation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/ssmincidents/generated.json b/service/ssmincidents/generated.json index 3321900109f..2d7308b4c4a 100644 --- a/service/ssmincidents/generated.json +++ b/service/ssmincidents/generated.json @@ -52,6 +52,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/ssmincidents/sra_operation_order_test.go b/service/ssmincidents/sra_operation_order_test.go new file mode 100644 index 00000000000..6c2af66bbef --- /dev/null +++ b/service/ssmincidents/sra_operation_order_test.go @@ -0,0 +1,1106 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmincidents + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchGetIncidentFindingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetIncidentFindings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateReplicationSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateReplicationSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateResponsePlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateResponsePlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTimelineEventSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTimelineEvent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIncidentRecordSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIncidentRecord(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteReplicationSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteReplicationSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResponsePlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResponsePlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTimelineEventSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTimelineEvent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIncidentRecordSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIncidentRecord(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReplicationSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReplicationSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourcePoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourcePolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResponsePlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResponsePlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTimelineEventSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTimelineEvent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIncidentFindingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIncidentFindings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIncidentRecordsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIncidentRecords(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRelatedItemsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRelatedItems(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReplicationSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReplicationSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResponsePlansSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResponsePlans(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTimelineEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTimelineEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartIncidentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartIncident(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDeletionProtectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDeletionProtection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIncidentRecordSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIncidentRecord(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRelatedItemsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRelatedItems(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateReplicationSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateReplicationSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateResponsePlanSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateResponsePlan(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTimelineEventSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTimelineEvent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/ssmquicksetup/generated.json b/service/ssmquicksetup/generated.json index 026c5d3285a..02c5d7075e8 100644 --- a/service/ssmquicksetup/generated.json +++ b/service/ssmquicksetup/generated.json @@ -35,6 +35,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/ssmquicksetup/sra_operation_order_test.go b/service/ssmquicksetup/sra_operation_order_test.go new file mode 100644 index 00000000000..721391b9f19 --- /dev/null +++ b/service/ssmquicksetup/sra_operation_order_test.go @@ -0,0 +1,511 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmquicksetup + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateConfigurationManagerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConfigurationManager(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConfigurationManagerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConfigurationManager(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConfigurationManagerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConfigurationManager(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServiceSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConfigurationManagersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConfigurationManagers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListQuickSetupTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListQuickSetupTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConfigurationDefinitionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConfigurationDefinition(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConfigurationManagerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConfigurationManager(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateServiceSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateServiceSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/ssmsap/generated.json b/service/ssmsap/generated.json index 44de37737aa..2f203be2370 100644 --- a/service/ssmsap/generated.json +++ b/service/ssmsap/generated.json @@ -42,6 +42,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/ssmsap/sra_operation_order_test.go b/service/ssmsap/sra_operation_order_test.go new file mode 100644 index 00000000000..90ec4d907a1 --- /dev/null +++ b/service/ssmsap/sra_operation_order_test.go @@ -0,0 +1,756 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmsap + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpDeleteResourcePermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourcePermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetComponentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetComponent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDatabaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDatabase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourcePermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourcePermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListComponentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListComponents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDatabasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDatabases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOperationEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOperationEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOperationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOperations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResourcePermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResourcePermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartApplicationRefreshSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartApplicationRefresh(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApplicationSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApplicationSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/sso/generated.json b/service/sso/generated.json index abbb7ea1834..1a88fe4df8e 100644 --- a/service/sso/generated.json +++ b/service/sso/generated.json @@ -25,6 +25,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/errors.go", "types/types.go", "validators.go" diff --git a/service/sso/sra_operation_order_test.go b/service/sso/sra_operation_order_test.go new file mode 100644 index 00000000000..cff8f7bb340 --- /dev/null +++ b/service/sso/sra_operation_order_test.go @@ -0,0 +1,161 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sso + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpGetRoleCredentialsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRoleCredentials(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccountRolesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccountRoles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccountsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccounts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpLogoutSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Logout(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/ssoadmin/generated.json b/service/ssoadmin/generated.json index deddbc15410..aa88f237c90 100644 --- a/service/ssoadmin/generated.json +++ b/service/ssoadmin/generated.json @@ -98,6 +98,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/ssoadmin/sra_operation_order_test.go b/service/ssoadmin/sra_operation_order_test.go new file mode 100644 index 00000000000..32a91c98c53 --- /dev/null +++ b/service/ssoadmin/sra_operation_order_test.go @@ -0,0 +1,2576 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssoadmin + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAttachCustomerManagedPolicyReferenceToPermissionSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachCustomerManagedPolicyReferenceToPermissionSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachManagedPolicyToPermissionSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachManagedPolicyToPermissionSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAccountAssignmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAccountAssignment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateApplicationAssignmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateApplicationAssignment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInstanceAccessControlAttributeConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInstanceAccessControlAttributeConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePermissionSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePermissionSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTrustedTokenIssuerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTrustedTokenIssuer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccountAssignmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccountAssignment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationAccessScopeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplicationAccessScope(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationAssignmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplicationAssignment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationAuthenticationMethodSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplicationAuthenticationMethod(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteApplicationGrantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteApplicationGrant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInlinePolicyFromPermissionSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInlinePolicyFromPermissionSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInstanceAccessControlAttributeConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInstanceAccessControlAttributeConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePermissionsBoundaryFromPermissionSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePermissionsBoundaryFromPermissionSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePermissionSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePermissionSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTrustedTokenIssuerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTrustedTokenIssuer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccountAssignmentCreationStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccountAssignmentCreationStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccountAssignmentDeletionStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccountAssignmentDeletionStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeApplicationAssignmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeApplicationAssignment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeApplicationProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeApplicationProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInstanceAccessControlAttributeConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInstanceAccessControlAttributeConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePermissionSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePermissionSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribePermissionSetProvisioningStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribePermissionSetProvisioningStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTrustedTokenIssuerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTrustedTokenIssuer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachCustomerManagedPolicyReferenceFromPermissionSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachCustomerManagedPolicyReferenceFromPermissionSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachManagedPolicyFromPermissionSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachManagedPolicyFromPermissionSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApplicationAccessScopeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApplicationAccessScope(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApplicationAssignmentConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApplicationAssignmentConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApplicationAuthenticationMethodSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApplicationAuthenticationMethod(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetApplicationGrantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetApplicationGrant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInlinePolicyForPermissionSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInlinePolicyForPermissionSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPermissionsBoundaryForPermissionSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPermissionsBoundaryForPermissionSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccountAssignmentCreationStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccountAssignmentCreationStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccountAssignmentDeletionStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccountAssignmentDeletionStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccountAssignmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccountAssignments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccountAssignmentsForPrincipalSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccountAssignmentsForPrincipal(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccountsForProvisionedPermissionSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccountsForProvisionedPermissionSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationAccessScopesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplicationAccessScopes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationAssignmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplicationAssignments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationAssignmentsForPrincipalSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplicationAssignmentsForPrincipal(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationAuthenticationMethodsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplicationAuthenticationMethods(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationGrantsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplicationGrants(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationProvidersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplicationProviders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCustomerManagedPolicyReferencesInPermissionSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCustomerManagedPolicyReferencesInPermissionSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListManagedPoliciesInPermissionSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListManagedPoliciesInPermissionSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPermissionSetProvisioningStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPermissionSetProvisioningStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPermissionSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPermissionSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPermissionSetsProvisionedToAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPermissionSetsProvisionedToAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTrustedTokenIssuersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTrustedTokenIssuers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpProvisionPermissionSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ProvisionPermissionSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutApplicationAccessScopeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutApplicationAccessScope(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutApplicationAssignmentConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutApplicationAssignmentConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutApplicationAuthenticationMethodSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutApplicationAuthenticationMethod(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutApplicationGrantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutApplicationGrant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutInlinePolicyToPermissionSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutInlinePolicyToPermissionSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutPermissionsBoundaryToPermissionSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutPermissionsBoundaryToPermissionSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateInstanceAccessControlAttributeConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateInstanceAccessControlAttributeConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePermissionSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePermissionSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTrustedTokenIssuerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTrustedTokenIssuer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/ssooidc/generated.json b/service/ssooidc/generated.json index 23d72cf0fd2..35f180975a8 100644 --- a/service/ssooidc/generated.json +++ b/service/ssooidc/generated.json @@ -25,6 +25,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/errors.go", "types/types.go", "validators.go" diff --git a/service/ssooidc/sra_operation_order_test.go b/service/ssooidc/sra_operation_order_test.go new file mode 100644 index 00000000000..702d655c4cd --- /dev/null +++ b/service/ssooidc/sra_operation_order_test.go @@ -0,0 +1,161 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssooidc + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTokenWithIAMSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTokenWithIAM(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterClientSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterClient(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDeviceAuthorizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDeviceAuthorization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/storagegateway/generated.json b/service/storagegateway/generated.json index 1a0d1b8e7ff..36dd4d06732 100644 --- a/service/storagegateway/generated.json +++ b/service/storagegateway/generated.json @@ -117,6 +117,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/storagegateway/sra_operation_order_test.go b/service/storagegateway/sra_operation_order_test.go new file mode 100644 index 00000000000..96a1570bdd6 --- /dev/null +++ b/service/storagegateway/sra_operation_order_test.go @@ -0,0 +1,3381 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package storagegateway + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpActivateGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ActivateGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddCacheSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddCache(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddTagsToResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddTagsToResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddUploadBufferSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddUploadBuffer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddWorkingStorageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddWorkingStorage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssignTapePoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssignTapePool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateFileSystemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateFileSystem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAttachVolumeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AttachVolume(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelArchivalSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelArchival(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelCacheReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelCacheReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelRetrievalSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelRetrieval(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCachediSCSIVolumeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCachediSCSIVolume(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateNFSFileShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNFSFileShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSMBFileShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSMBFileShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSnapshotSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSnapshot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSnapshotFromVolumeRecoveryPointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSnapshotFromVolumeRecoveryPoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStorediSCSIVolumeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStorediSCSIVolume(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTapePoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTapePool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTapesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTapes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTapeWithBarcodeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTapeWithBarcode(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAutomaticTapeCreationPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAutomaticTapeCreationPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBandwidthRateLimitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBandwidthRateLimit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCacheReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCacheReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteChapCredentialsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteChapCredentials(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFileShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFileShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSnapshotScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSnapshotSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTapeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTape(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTapeArchiveSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTapeArchive(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTapePoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTapePool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVolumeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVolume(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAvailabilityMonitorTestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAvailabilityMonitorTest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBandwidthRateLimitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBandwidthRateLimit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBandwidthRateLimitScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBandwidthRateLimitSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCacheSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCache(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCachediSCSIVolumesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCachediSCSIVolumes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCacheReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCacheReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeChapCredentialsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeChapCredentials(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFileSystemAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFileSystemAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGatewayInformationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGatewayInformation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMaintenanceStartTimeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMaintenanceStartTime(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeNFSFileSharesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeNFSFileShares(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSMBFileSharesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSMBFileShares(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSMBSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSMBSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSnapshotScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSnapshotSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeStorediSCSIVolumesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeStorediSCSIVolumes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTapeArchivesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTapeArchives(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTapeRecoveryPointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTapeRecoveryPoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTapesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTapes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeUploadBufferSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeUploadBuffer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeVTLDevicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeVTLDevices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWorkingStorageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWorkingStorage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetachVolumeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetachVolume(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisableGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisableGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateFileSystemSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateFileSystem(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEvictFilesFailingUploadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EvictFilesFailingUpload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpJoinDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.JoinDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAutomaticTapeCreationPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAutomaticTapeCreationPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCacheReportsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCacheReports(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFileSharesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFileShares(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFileSystemAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFileSystemAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGatewaysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGateways(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLocalDisksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLocalDisks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTapePoolsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTapePools(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTapesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTapes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVolumeInitiatorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVolumeInitiators(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVolumeRecoveryPointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVolumeRecoveryPoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVolumesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVolumes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNotifyWhenUploadedSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NotifyWhenUploaded(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRefreshCacheSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RefreshCache(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveTagsFromResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveTagsFromResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetCacheSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetCache(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRetrieveTapeArchiveSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RetrieveTapeArchive(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRetrieveTapeRecoveryPointSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RetrieveTapeRecoveryPoint(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetLocalConsolePasswordSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetLocalConsolePassword(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSetSMBGuestPasswordSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SetSMBGuestPassword(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpShutdownGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ShutdownGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartAvailabilityMonitorTestSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartAvailabilityMonitorTest(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartCacheReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartCacheReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAutomaticTapeCreationPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAutomaticTapeCreationPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBandwidthRateLimitSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBandwidthRateLimit(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBandwidthRateLimitScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBandwidthRateLimitSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateChapCredentialsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateChapCredentials(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFileSystemAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFileSystemAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGatewayInformationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGatewayInformation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGatewaySoftwareNowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGatewaySoftwareNow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMaintenanceStartTimeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMaintenanceStartTime(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateNFSFileShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateNFSFileShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSMBFileShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSMBFileShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSMBFileShareVisibilitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSMBFileShareVisibility(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSMBLocalGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSMBLocalGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSMBSecurityStrategySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSMBSecurityStrategy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSnapshotScheduleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSnapshotSchedule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVTLDeviceTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVTLDeviceType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/sts/generated.json b/service/sts/generated.json index 643c5c69483..86bb3b79be4 100644 --- a/service/sts/generated.json +++ b/service/sts/generated.json @@ -32,6 +32,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/errors.go", "types/types.go", "validators.go" diff --git a/service/sts/sra_operation_order_test.go b/service/sts/sra_operation_order_test.go new file mode 100644 index 00000000000..efce36e9332 --- /dev/null +++ b/service/sts/sra_operation_order_test.go @@ -0,0 +1,336 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sts + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssumeRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssumeRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssumeRoleWithSAMLSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssumeRoleWithSAML(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssumeRoleWithWebIdentitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssumeRoleWithWebIdentity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssumeRootSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssumeRoot(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDecodeAuthorizationMessageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DecodeAuthorizationMessage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccessKeyInfoSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccessKeyInfo(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCallerIdentitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCallerIdentity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFederationTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFederationToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSessionTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSessionToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/supplychain/generated.json b/service/supplychain/generated.json index 248e90a64f6..ee723109d9c 100644 --- a/service/supplychain/generated.json +++ b/service/supplychain/generated.json @@ -42,6 +42,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/supplychain/sra_operation_order_test.go b/service/supplychain/sra_operation_order_test.go new file mode 100644 index 00000000000..9d945d899fc --- /dev/null +++ b/service/supplychain/sra_operation_order_test.go @@ -0,0 +1,756 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package supplychain + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateBillOfMaterialsImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBillOfMaterialsImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataIntegrationFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataIntegrationFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataLakeDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataLakeDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataIntegrationFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataIntegrationFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataLakeDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataLakeDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBillOfMaterialsImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBillOfMaterialsImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataIntegrationFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataIntegrationFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataLakeDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataLakeDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataIntegrationFlowsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataIntegrationFlows(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataLakeDatasetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataLakeDatasets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendDataIntegrationEventSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendDataIntegrationEvent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDataIntegrationFlowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataIntegrationFlow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDataLakeDatasetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataLakeDataset(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/support/generated.json b/service/support/generated.json index 048b6f70457..a833080436f 100644 --- a/service/support/generated.json +++ b/service/support/generated.json @@ -37,6 +37,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/errors.go", "types/types.go", "validators.go" diff --git a/service/support/sra_operation_order_test.go b/service/support/sra_operation_order_test.go new file mode 100644 index 00000000000..ce592079a67 --- /dev/null +++ b/service/support/sra_operation_order_test.go @@ -0,0 +1,581 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package support + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAddAttachmentsToSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddAttachmentsToSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddCommunicationToCaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddCommunicationToCase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAttachmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAttachment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCommunicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCommunications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCreateCaseOptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCreateCaseOptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeServicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeServices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSeverityLevelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSeverityLevels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSupportedLanguagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSupportedLanguages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTrustedAdvisorCheckRefreshStatusesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTrustedAdvisorCheckRefreshStatuses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTrustedAdvisorCheckResultSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTrustedAdvisorCheckResult(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTrustedAdvisorChecksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTrustedAdvisorChecks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTrustedAdvisorCheckSummariesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTrustedAdvisorCheckSummaries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRefreshTrustedAdvisorCheckSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RefreshTrustedAdvisorCheck(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResolveCaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResolveCase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/supportapp/generated.json b/service/supportapp/generated.json index c142273ad86..8733c40909c 100644 --- a/service/supportapp/generated.json +++ b/service/supportapp/generated.json @@ -31,6 +31,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/supportapp/sra_operation_order_test.go b/service/supportapp/sra_operation_order_test.go new file mode 100644 index 00000000000..6b30133f947 --- /dev/null +++ b/service/supportapp/sra_operation_order_test.go @@ -0,0 +1,371 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package supportapp + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateSlackChannelConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSlackChannelConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccountAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccountAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSlackChannelConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSlackChannelConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSlackWorkspaceConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSlackWorkspaceConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccountAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccountAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSlackChannelConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSlackChannelConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSlackWorkspaceConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSlackWorkspaceConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAccountAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAccountAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterSlackWorkspaceForOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterSlackWorkspaceForOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSlackChannelConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSlackChannelConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/swf/generated.json b/service/swf/generated.json index 9764f391787..d28a4d15886 100644 --- a/service/swf/generated.json +++ b/service/swf/generated.json @@ -60,6 +60,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/swf/sra_operation_order_test.go b/service/swf/sra_operation_order_test.go new file mode 100644 index 00000000000..34f5dfba369 --- /dev/null +++ b/service/swf/sra_operation_order_test.go @@ -0,0 +1,1386 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package swf + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCountClosedWorkflowExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CountClosedWorkflowExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCountOpenWorkflowExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CountOpenWorkflowExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCountPendingActivityTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CountPendingActivityTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCountPendingDecisionTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CountPendingDecisionTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteActivityTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteActivityType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWorkflowTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWorkflowType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeprecateActivityTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeprecateActivityType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeprecateDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeprecateDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeprecateWorkflowTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeprecateWorkflowType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeActivityTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeActivityType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWorkflowExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWorkflowExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWorkflowTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWorkflowType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWorkflowExecutionHistorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWorkflowExecutionHistory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListActivityTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListActivityTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListClosedWorkflowExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListClosedWorkflowExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDomainsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDomains(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOpenWorkflowExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOpenWorkflowExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkflowTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkflowTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPollForActivityTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PollForActivityTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPollForDecisionTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PollForDecisionTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRecordActivityTaskHeartbeatSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RecordActivityTaskHeartbeat(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterActivityTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterActivityType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterWorkflowTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterWorkflowType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRequestCancelWorkflowExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RequestCancelWorkflowExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRespondActivityTaskCanceledSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RespondActivityTaskCanceled(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRespondActivityTaskCompletedSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RespondActivityTaskCompleted(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRespondActivityTaskFailedSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RespondActivityTaskFailed(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRespondDecisionTaskCompletedSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RespondDecisionTaskCompleted(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSignalWorkflowExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SignalWorkflowExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartWorkflowExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartWorkflowExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTerminateWorkflowExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TerminateWorkflowExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUndeprecateActivityTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UndeprecateActivityType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUndeprecateDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UndeprecateDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUndeprecateWorkflowTypeSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UndeprecateWorkflowType(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/synthetics/generated.json b/service/synthetics/generated.json index 6d4361133ff..e2e48e4987f 100644 --- a/service/synthetics/generated.json +++ b/service/synthetics/generated.json @@ -42,6 +42,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/synthetics/sra_operation_order_test.go b/service/synthetics/sra_operation_order_test.go new file mode 100644 index 00000000000..7d9b063fecf --- /dev/null +++ b/service/synthetics/sra_operation_order_test.go @@ -0,0 +1,756 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package synthetics + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCanarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCanary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCanarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCanary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCanariesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCanaries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCanariesLastRunSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCanariesLastRun(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRuntimeVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRuntimeVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCanarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCanary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCanaryRunsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCanaryRuns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssociatedGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssociatedGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGroupResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGroupResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartCanarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartCanary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopCanarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopCanary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCanarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCanary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/taxsettings/generated.json b/service/taxsettings/generated.json index c0654afdc27..644ddacaa1b 100644 --- a/service/taxsettings/generated.json +++ b/service/taxsettings/generated.json @@ -37,6 +37,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/taxsettings/sra_operation_order_test.go b/service/taxsettings/sra_operation_order_test.go new file mode 100644 index 00000000000..7250c6d116e --- /dev/null +++ b/service/taxsettings/sra_operation_order_test.go @@ -0,0 +1,581 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package taxsettings + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchDeleteTaxRegistrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchDeleteTaxRegistration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchGetTaxExemptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetTaxExemptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchPutTaxRegistrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchPutTaxRegistration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSupplementalTaxRegistrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSupplementalTaxRegistration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTaxRegistrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTaxRegistration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTaxExemptionTypesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTaxExemptionTypes(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTaxInheritanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTaxInheritance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTaxRegistrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTaxRegistration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTaxRegistrationDocumentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTaxRegistrationDocument(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSupplementalTaxRegistrationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSupplementalTaxRegistrations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTaxExemptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTaxExemptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTaxRegistrationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTaxRegistrations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutSupplementalTaxRegistrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutSupplementalTaxRegistration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutTaxExemptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutTaxExemption(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutTaxInheritanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutTaxInheritance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutTaxRegistrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutTaxRegistration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/textract/generated.json b/service/textract/generated.json index 94d064a8c18..71a7a082087 100644 --- a/service/textract/generated.json +++ b/service/textract/generated.json @@ -46,6 +46,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/textract/sra_operation_order_test.go b/service/textract/sra_operation_order_test.go new file mode 100644 index 00000000000..44da7496dd7 --- /dev/null +++ b/service/textract/sra_operation_order_test.go @@ -0,0 +1,896 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package textract + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAnalyzeDocumentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AnalyzeDocument(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAnalyzeExpenseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AnalyzeExpense(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAnalyzeIDSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AnalyzeID(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAdapterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAdapter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAdapterVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAdapterVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAdapterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAdapter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAdapterVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAdapterVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDetectDocumentTextSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DetectDocumentText(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAdapterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAdapter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAdapterVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAdapterVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDocumentAnalysisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDocumentAnalysis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDocumentTextDetectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDocumentTextDetection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetExpenseAnalysisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetExpenseAnalysis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLendingAnalysisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLendingAnalysis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLendingAnalysisSummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLendingAnalysisSummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAdaptersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAdapters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAdapterVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAdapterVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDocumentAnalysisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDocumentAnalysis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDocumentTextDetectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDocumentTextDetection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartExpenseAnalysisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartExpenseAnalysis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartLendingAnalysisSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartLendingAnalysis(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAdapterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAdapter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/timestreaminfluxdb/generated.json b/service/timestreaminfluxdb/generated.json index a0e711349d7..dee766ca1af 100644 --- a/service/timestreaminfluxdb/generated.json +++ b/service/timestreaminfluxdb/generated.json @@ -38,6 +38,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/timestreaminfluxdb/sra_operation_order_test.go b/service/timestreaminfluxdb/sra_operation_order_test.go new file mode 100644 index 00000000000..d2eb48c82b3 --- /dev/null +++ b/service/timestreaminfluxdb/sra_operation_order_test.go @@ -0,0 +1,616 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package timestreaminfluxdb + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateDbClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDbCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDbInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDbInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDbParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDbParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDbClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDbCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDbInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDbInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDbClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDbCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDbInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDbInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDbParameterGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDbParameterGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDbClustersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDbClusters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDbInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDbInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDbInstancesForClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDbInstancesForCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDbParameterGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDbParameterGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDbClusterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDbCluster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDbInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDbInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/timestreamquery/generated.json b/service/timestreamquery/generated.json index 0111169b3ab..227b15bdbb7 100644 --- a/service/timestreamquery/generated.json +++ b/service/timestreamquery/generated.json @@ -37,6 +37,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/timestreamquery/sra_operation_order_test.go b/service/timestreamquery/sra_operation_order_test.go new file mode 100644 index 00000000000..c936ba2645d --- /dev/null +++ b/service/timestreamquery/sra_operation_order_test.go @@ -0,0 +1,546 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package timestreamquery + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCancelQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateScheduledQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateScheduledQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteScheduledQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteScheduledQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccountSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccountSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeScheduledQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeScheduledQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExecuteScheduledQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExecuteScheduledQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListScheduledQueriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListScheduledQueries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPrepareQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PrepareQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.Query(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAccountSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAccountSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateScheduledQuerySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateScheduledQuery(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/timestreamwrite/generated.json b/service/timestreamwrite/generated.json index 883e917ff39..d0920a1c175 100644 --- a/service/timestreamwrite/generated.json +++ b/service/timestreamwrite/generated.json @@ -41,6 +41,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/timestreamwrite/sra_operation_order_test.go b/service/timestreamwrite/sra_operation_order_test.go new file mode 100644 index 00000000000..398b87ba3aa --- /dev/null +++ b/service/timestreamwrite/sra_operation_order_test.go @@ -0,0 +1,686 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package timestreamwrite + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateBatchLoadTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBatchLoadTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDatabaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDatabase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDatabaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDatabase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBatchLoadTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBatchLoadTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDatabaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDatabase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEndpointsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEndpoints(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBatchLoadTasksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBatchLoadTasks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDatabasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDatabases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTablesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTables(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResumeBatchLoadTaskSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResumeBatchLoadTask(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDatabaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDatabase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTableSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTable(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpWriteRecordsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.WriteRecords(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/tnb/generated.json b/service/tnb/generated.json index 2580c75ec2a..d84863321c4 100644 --- a/service/tnb/generated.json +++ b/service/tnb/generated.json @@ -58,6 +58,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/tnb/sra_operation_order_test.go b/service/tnb/sra_operation_order_test.go new file mode 100644 index 00000000000..cc403f7761f --- /dev/null +++ b/service/tnb/sra_operation_order_test.go @@ -0,0 +1,1176 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package tnb + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCancelSolNetworkOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelSolNetworkOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSolFunctionPackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSolFunctionPackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSolNetworkInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSolNetworkInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSolNetworkPackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSolNetworkPackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSolFunctionPackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSolFunctionPackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSolNetworkInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSolNetworkInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSolNetworkPackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSolNetworkPackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSolFunctionInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSolFunctionInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSolFunctionPackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSolFunctionPackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSolFunctionPackageContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSolFunctionPackageContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSolFunctionPackageDescriptorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSolFunctionPackageDescriptor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSolNetworkInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSolNetworkInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSolNetworkOperationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSolNetworkOperation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSolNetworkPackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSolNetworkPackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSolNetworkPackageContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSolNetworkPackageContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSolNetworkPackageDescriptorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSolNetworkPackageDescriptor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInstantiateSolNetworkInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InstantiateSolNetworkInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSolFunctionInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSolFunctionInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSolFunctionPackagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSolFunctionPackages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSolNetworkInstancesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSolNetworkInstances(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSolNetworkOperationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSolNetworkOperations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSolNetworkPackagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSolNetworkPackages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutSolFunctionPackageContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutSolFunctionPackageContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutSolNetworkPackageContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutSolNetworkPackageContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTerminateSolNetworkInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TerminateSolNetworkInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSolFunctionPackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSolFunctionPackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSolNetworkInstanceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSolNetworkInstance(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSolNetworkPackageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSolNetworkPackage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpValidateSolFunctionPackageContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ValidateSolFunctionPackageContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpValidateSolNetworkPackageContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ValidateSolNetworkPackageContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/transcribe/generated.json b/service/transcribe/generated.json index 3c51195326f..b14951c9d6b 100644 --- a/service/transcribe/generated.json +++ b/service/transcribe/generated.json @@ -64,6 +64,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/transcribe/sra_operation_order_test.go b/service/transcribe/sra_operation_order_test.go new file mode 100644 index 00000000000..b3485bfeaf1 --- /dev/null +++ b/service/transcribe/sra_operation_order_test.go @@ -0,0 +1,1526 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package transcribe + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateCallAnalyticsCategorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCallAnalyticsCategory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLanguageModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLanguageModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMedicalVocabularySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMedicalVocabulary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVocabularySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVocabulary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateVocabularyFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateVocabularyFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCallAnalyticsCategorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCallAnalyticsCategory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCallAnalyticsJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCallAnalyticsJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLanguageModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLanguageModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMedicalScribeJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMedicalScribeJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMedicalTranscriptionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMedicalTranscriptionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMedicalVocabularySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMedicalVocabulary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTranscriptionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTranscriptionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVocabularySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVocabulary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteVocabularyFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteVocabularyFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeLanguageModelSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeLanguageModel(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCallAnalyticsCategorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCallAnalyticsCategory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCallAnalyticsJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCallAnalyticsJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMedicalScribeJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMedicalScribeJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMedicalTranscriptionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMedicalTranscriptionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMedicalVocabularySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMedicalVocabulary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTranscriptionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTranscriptionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVocabularySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVocabulary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetVocabularyFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetVocabularyFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCallAnalyticsCategoriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCallAnalyticsCategories(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCallAnalyticsJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCallAnalyticsJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLanguageModelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLanguageModels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMedicalScribeJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMedicalScribeJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMedicalTranscriptionJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMedicalTranscriptionJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMedicalVocabulariesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMedicalVocabularies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTranscriptionJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTranscriptionJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVocabulariesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVocabularies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListVocabularyFiltersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListVocabularyFilters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartCallAnalyticsJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartCallAnalyticsJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMedicalScribeJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMedicalScribeJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMedicalTranscriptionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMedicalTranscriptionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartTranscriptionJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartTranscriptionJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCallAnalyticsCategorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCallAnalyticsCategory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMedicalVocabularySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMedicalVocabulary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVocabularySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVocabulary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateVocabularyFilterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateVocabularyFilter(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/transcribestreaming/generated.json b/service/transcribestreaming/generated.json index c7de11b70a9..e8b4d044b86 100644 --- a/service/transcribestreaming/generated.json +++ b/service/transcribestreaming/generated.json @@ -28,6 +28,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/transcribestreaming/sra_operation_order_test.go b/service/transcribestreaming/sra_operation_order_test.go new file mode 100644 index 00000000000..49492ebe163 --- /dev/null +++ b/service/transcribestreaming/sra_operation_order_test.go @@ -0,0 +1,196 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package transcribestreaming + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpGetMedicalScribeStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMedicalScribeStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartCallAnalyticsStreamTranscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartCallAnalyticsStreamTranscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMedicalScribeStreamSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMedicalScribeStream(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMedicalStreamTranscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMedicalStreamTranscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartStreamTranscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartStreamTranscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/transfer/generated.json b/service/transfer/generated.json index f1e7d920b28..639cc6aab46 100644 --- a/service/transfer/generated.json +++ b/service/transfer/generated.json @@ -90,6 +90,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/transfer/sra_operation_order_test.go b/service/transfer/sra_operation_order_test.go new file mode 100644 index 00000000000..97bd95c8567 --- /dev/null +++ b/service/transfer/sra_operation_order_test.go @@ -0,0 +1,2436 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package transfer + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAgreementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAgreement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWebAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWebApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAgreementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAgreement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteHostKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteHostKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSshPublicKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSshPublicKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWebAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWebApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWebAppCustomizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWebAppCustomization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAgreementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAgreement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeExecutionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeExecution(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeHostKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeHostKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSecurityPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSecurityPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWebAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWebApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWebAppCustomizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWebAppCustomization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWorkflowSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWorkflow(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportHostKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportHostKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportSshPublicKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportSshPublicKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccessesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccesses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAgreementsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAgreements(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCertificatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCertificates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListConnectorsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListConnectors(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListExecutionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListExecutions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFileTransferResultsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFileTransferResults(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListHostKeysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListHostKeys(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSecurityPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSecurityPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUsersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUsers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWebAppsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWebApps(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkflowsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkflows(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSendWorkflowStepStateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SendWorkflowStepState(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartDirectoryListingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartDirectoryListing(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartFileTransferSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartFileTransfer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestConnectionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestConnection(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestIdentityProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestIdentityProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAccessSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAccess(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAgreementSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAgreement(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConnectorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConnector(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateHostKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateHostKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateServerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateServer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWebAppSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWebApp(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWebAppCustomizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWebAppCustomization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/translate/generated.json b/service/translate/generated.json index 9b2842ac815..1506c161dc2 100644 --- a/service/translate/generated.json +++ b/service/translate/generated.json @@ -40,6 +40,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/translate/sra_operation_order_test.go b/service/translate/sra_operation_order_test.go new file mode 100644 index 00000000000..a030ca9fb30 --- /dev/null +++ b/service/translate/sra_operation_order_test.go @@ -0,0 +1,686 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package translate + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateParallelDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateParallelData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteParallelDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteParallelData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTerminologySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTerminology(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTextTranslationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTextTranslationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetParallelDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetParallelData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTerminologySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTerminology(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportTerminologySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportTerminology(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLanguagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLanguages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListParallelDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListParallelData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTerminologiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTerminologies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTextTranslationJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTextTranslationJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartTextTranslationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartTextTranslationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopTextTranslationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopTextTranslationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTranslateDocumentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TranslateDocument(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTranslateTextSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TranslateText(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateParallelDataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateParallelData(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/trustedadvisor/generated.json b/service/trustedadvisor/generated.json index 0c0bd7d8025..aaa7d9272e3 100644 --- a/service/trustedadvisor/generated.json +++ b/service/trustedadvisor/generated.json @@ -32,6 +32,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/trustedadvisor/sra_operation_order_test.go b/service/trustedadvisor/sra_operation_order_test.go new file mode 100644 index 00000000000..c42df075077 --- /dev/null +++ b/service/trustedadvisor/sra_operation_order_test.go @@ -0,0 +1,406 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package trustedadvisor + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchUpdateRecommendationResourceExclusionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchUpdateRecommendationResourceExclusion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetOrganizationRecommendationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetOrganizationRecommendation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRecommendationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRecommendation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListChecksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListChecks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOrganizationRecommendationAccountsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOrganizationRecommendationAccounts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOrganizationRecommendationResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOrganizationRecommendationResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOrganizationRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOrganizationRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRecommendationResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRecommendationResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateOrganizationRecommendationLifecycleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateOrganizationRecommendationLifecycle(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRecommendationLifecycleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRecommendationLifecycle(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/verifiedpermissions/generated.json b/service/verifiedpermissions/generated.json index 8f634ac4c75..188e2abb5b7 100644 --- a/service/verifiedpermissions/generated.json +++ b/service/verifiedpermissions/generated.json @@ -48,6 +48,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/verifiedpermissions/sra_operation_order_test.go b/service/verifiedpermissions/sra_operation_order_test.go new file mode 100644 index 00000000000..2f387bc2353 --- /dev/null +++ b/service/verifiedpermissions/sra_operation_order_test.go @@ -0,0 +1,966 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package verifiedpermissions + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchGetPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchIsAuthorizedSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchIsAuthorized(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpBatchIsAuthorizedWithTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchIsAuthorizedWithToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIdentitySourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIdentitySource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePolicyStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePolicyStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePolicyTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePolicyTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIdentitySourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIdentitySource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePolicyStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePolicyStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePolicyTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePolicyTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIdentitySourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIdentitySource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPolicyStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPolicyStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPolicyTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPolicyTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSchemaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSchema(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpIsAuthorizedSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.IsAuthorized(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpIsAuthorizedWithTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.IsAuthorizedWithToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIdentitySourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIdentitySources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPolicyStoresSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPolicyStores(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPolicyTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPolicyTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutSchemaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutSchema(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIdentitySourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIdentitySource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePolicyStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePolicyStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePolicyTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePolicyTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/voiceid/generated.json b/service/voiceid/generated.json index 1efbb7fb532..5cba9c10d95 100644 --- a/service/voiceid/generated.json +++ b/service/voiceid/generated.json @@ -50,6 +50,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/voiceid/sra_operation_order_test.go b/service/voiceid/sra_operation_order_test.go new file mode 100644 index 00000000000..4722e339c72 --- /dev/null +++ b/service/voiceid/sra_operation_order_test.go @@ -0,0 +1,1036 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package voiceid + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateFraudsterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateFraudster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWatchlistSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWatchlist(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFraudsterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFraudster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSpeakerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSpeaker(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWatchlistSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWatchlist(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFraudsterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFraudster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFraudsterRegistrationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFraudsterRegistrationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSpeakerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSpeaker(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeSpeakerEnrollmentJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeSpeakerEnrollmentJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWatchlistSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWatchlist(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateFraudsterSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateFraudster(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpEvaluateSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.EvaluateSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDomainsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDomains(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFraudsterRegistrationJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFraudsterRegistrationJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListFraudstersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListFraudsters(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSpeakerEnrollmentJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSpeakerEnrollmentJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSpeakersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSpeakers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWatchlistsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWatchlists(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpOptOutSpeakerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.OptOutSpeaker(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartFraudsterRegistrationJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartFraudsterRegistrationJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartSpeakerEnrollmentJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartSpeakerEnrollmentJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWatchlistSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWatchlist(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/vpclattice/generated.json b/service/vpclattice/generated.json index e147317285d..b4172763750 100644 --- a/service/vpclattice/generated.json +++ b/service/vpclattice/generated.json @@ -90,6 +90,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/vpclattice/sra_operation_order_test.go b/service/vpclattice/sra_operation_order_test.go new file mode 100644 index 00000000000..ce8ef1ca392 --- /dev/null +++ b/service/vpclattice/sra_operation_order_test.go @@ -0,0 +1,2436 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package vpclattice + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchUpdateRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchUpdateRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAccessLogSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAccessLogSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateListenerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateListener(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateResourceConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateResourceConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateResourceGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateResourceGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateServiceNetworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateServiceNetwork(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateServiceNetworkResourceAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateServiceNetworkResourceAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateServiceNetworkServiceAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateServiceNetworkServiceAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateServiceNetworkVpcAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateServiceNetworkVpcAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTargetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTargetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccessLogSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccessLogSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAuthPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAuthPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteListenerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteListener(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourceConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourceConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourceEndpointAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourceEndpointAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourceGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourceGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteServiceNetworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteServiceNetwork(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteServiceNetworkResourceAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteServiceNetworkResourceAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteServiceNetworkServiceAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteServiceNetworkServiceAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteServiceNetworkVpcAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteServiceNetworkVpcAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTargetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTargetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterTargetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterTargets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccessLogSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccessLogSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAuthPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAuthPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetListenerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetListener(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourceConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourceConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourceGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourceGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceNetworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServiceNetwork(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceNetworkResourceAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServiceNetworkResourceAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceNetworkServiceAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServiceNetworkServiceAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceNetworkVpcAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServiceNetworkVpcAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTargetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTargetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccessLogSubscriptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccessLogSubscriptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListListenersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListListeners(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceEndpointAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceEndpointAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceGatewaysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceGateways(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServiceNetworkResourceAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServiceNetworkResourceAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServiceNetworksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServiceNetworks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServiceNetworkServiceAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServiceNetworkServiceAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServiceNetworkVpcAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServiceNetworkVpcAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServiceNetworkVpcEndpointAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServiceNetworkVpcEndpointAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListServicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListServices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTargetGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTargetGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTargetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTargets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAuthPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAuthPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterTargetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterTargets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAccessLogSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAccessLogSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateListenerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateListener(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateResourceConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateResourceConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateResourceGatewaySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateResourceGateway(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateServiceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateService(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateServiceNetworkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateServiceNetwork(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateServiceNetworkVpcAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateServiceNetworkVpcAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTargetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTargetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/waf/generated.json b/service/waf/generated.json index 7aaba7a3d2c..8bf901016c2 100644 --- a/service/waf/generated.json +++ b/service/waf/generated.json @@ -98,6 +98,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/waf/sra_operation_order_test.go b/service/waf/sra_operation_order_test.go new file mode 100644 index 00000000000..5348b37617d --- /dev/null +++ b/service/waf/sra_operation_order_test.go @@ -0,0 +1,2716 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package waf + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateByteMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateByteMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGeoMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGeoMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIPSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIPSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRateBasedRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRateBasedRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRegexMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRegexMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRegexPatternSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRegexPatternSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRuleGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRuleGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSizeConstraintSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSizeConstraintSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSqlInjectionMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSqlInjectionMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWebACLSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWebACL(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWebACLMigrationStackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWebACLMigrationStack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateXssMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateXssMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteByteMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteByteMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGeoMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGeoMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIPSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIPSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLoggingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLoggingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePermissionPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePermissionPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRateBasedRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRateBasedRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRegexMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRegexMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRegexPatternSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRegexPatternSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRuleGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRuleGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSizeConstraintSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSizeConstraintSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSqlInjectionMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSqlInjectionMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWebACLSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWebACL(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteXssMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteXssMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetByteMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetByteMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetChangeTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetChangeToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetChangeTokenStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetChangeTokenStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGeoMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGeoMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIPSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIPSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLoggingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLoggingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPermissionPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPermissionPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRateBasedRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRateBasedRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRateBasedRuleManagedKeysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRateBasedRuleManagedKeys(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRegexMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRegexMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRegexPatternSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRegexPatternSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRuleGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRuleGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSampledRequestsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSampledRequests(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSizeConstraintSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSizeConstraintSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSqlInjectionMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSqlInjectionMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWebACLSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWebACL(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetXssMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetXssMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListActivatedRulesInRuleGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListActivatedRulesInRuleGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListByteMatchSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListByteMatchSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGeoMatchSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGeoMatchSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIPSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIPSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLoggingConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLoggingConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRateBasedRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRateBasedRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRegexMatchSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRegexMatchSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRegexPatternSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRegexPatternSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRuleGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRuleGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSizeConstraintSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSizeConstraintSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSqlInjectionMatchSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSqlInjectionMatchSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSubscribedRuleGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSubscribedRuleGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWebACLsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWebACLs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListXssMatchSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListXssMatchSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutLoggingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutLoggingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutPermissionPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutPermissionPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateByteMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateByteMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGeoMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGeoMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIPSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIPSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRateBasedRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRateBasedRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRegexMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRegexMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRegexPatternSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRegexPatternSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRuleGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRuleGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSizeConstraintSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSizeConstraintSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSqlInjectionMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSqlInjectionMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWebACLSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWebACL(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateXssMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateXssMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/wafregional/generated.json b/service/wafregional/generated.json index ecb41b33272..84fddcbcb78 100644 --- a/service/wafregional/generated.json +++ b/service/wafregional/generated.json @@ -102,6 +102,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/wafregional/sra_operation_order_test.go b/service/wafregional/sra_operation_order_test.go new file mode 100644 index 00000000000..08d2794bae3 --- /dev/null +++ b/service/wafregional/sra_operation_order_test.go @@ -0,0 +1,2856 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wafregional + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateWebACLSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateWebACL(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateByteMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateByteMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGeoMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGeoMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIPSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIPSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRateBasedRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRateBasedRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRegexMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRegexMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRegexPatternSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRegexPatternSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRuleGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRuleGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSizeConstraintSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSizeConstraintSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSqlInjectionMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSqlInjectionMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWebACLSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWebACL(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWebACLMigrationStackSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWebACLMigrationStack(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateXssMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateXssMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteByteMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteByteMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGeoMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGeoMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIPSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIPSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLoggingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLoggingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePermissionPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePermissionPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRateBasedRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRateBasedRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRegexMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRegexMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRegexPatternSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRegexPatternSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRuleGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRuleGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSizeConstraintSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSizeConstraintSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSqlInjectionMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSqlInjectionMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWebACLSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWebACL(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteXssMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteXssMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateWebACLSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateWebACL(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetByteMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetByteMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetChangeTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetChangeToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetChangeTokenStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetChangeTokenStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGeoMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGeoMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIPSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIPSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLoggingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLoggingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPermissionPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPermissionPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRateBasedRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRateBasedRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRateBasedRuleManagedKeysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRateBasedRuleManagedKeys(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRegexMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRegexMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRegexPatternSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRegexPatternSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRuleGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRuleGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSampledRequestsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSampledRequests(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSizeConstraintSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSizeConstraintSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSqlInjectionMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSqlInjectionMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWebACLSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWebACL(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWebACLForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWebACLForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetXssMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetXssMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListActivatedRulesInRuleGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListActivatedRulesInRuleGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListByteMatchSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListByteMatchSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGeoMatchSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGeoMatchSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIPSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIPSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLoggingConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLoggingConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRateBasedRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRateBasedRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRegexMatchSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRegexMatchSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRegexPatternSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRegexPatternSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourcesForWebACLSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourcesForWebACL(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRuleGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRuleGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSizeConstraintSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSizeConstraintSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSqlInjectionMatchSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSqlInjectionMatchSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSubscribedRuleGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSubscribedRuleGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWebACLsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWebACLs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListXssMatchSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListXssMatchSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutLoggingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutLoggingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutPermissionPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutPermissionPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateByteMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateByteMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGeoMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGeoMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIPSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIPSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRateBasedRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRateBasedRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRegexMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRegexMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRegexPatternSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRegexPatternSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRuleGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRuleGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSizeConstraintSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSizeConstraintSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSqlInjectionMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSqlInjectionMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWebACLSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWebACL(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateXssMatchSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateXssMatchSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/wafv2/generated.json b/service/wafv2/generated.json index 3b38823d938..c7040dd7293 100644 --- a/service/wafv2/generated.json +++ b/service/wafv2/generated.json @@ -75,6 +75,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/wafv2/sra_operation_order_test.go b/service/wafv2/sra_operation_order_test.go new file mode 100644 index 00000000000..4f4511e068b --- /dev/null +++ b/service/wafv2/sra_operation_order_test.go @@ -0,0 +1,1911 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wafv2 + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateWebACLSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateWebACL(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCheckCapacitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CheckCapacity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAPIKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAPIKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIPSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIPSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRegexPatternSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRegexPatternSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateRuleGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateRuleGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWebACLSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWebACL(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAPIKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAPIKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFirewallManagerRuleGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFirewallManagerRuleGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIPSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIPSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLoggingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLoggingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePermissionPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePermissionPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRegexPatternSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRegexPatternSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRuleGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRuleGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWebACLSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWebACL(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAllManagedProductsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAllManagedProducts(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeManagedProductsByVendorSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeManagedProductsByVendor(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeManagedRuleGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeManagedRuleGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateWebACLSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateWebACL(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGenerateMobileSdkReleaseUrlSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GenerateMobileSdkReleaseUrl(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDecryptedAPIKeySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDecryptedAPIKey(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIPSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIPSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLoggingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLoggingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetManagedRuleSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetManagedRuleSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMobileSdkReleaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMobileSdkRelease(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPermissionPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPermissionPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRateBasedStatementManagedKeysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRateBasedStatementManagedKeys(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRegexPatternSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRegexPatternSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRuleGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRuleGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSampledRequestsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSampledRequests(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWebACLSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWebACL(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWebACLForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWebACLForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAPIKeysSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAPIKeys(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAvailableManagedRuleGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAvailableManagedRuleGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAvailableManagedRuleGroupVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAvailableManagedRuleGroupVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIPSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIPSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLoggingConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLoggingConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListManagedRuleSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListManagedRuleSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMobileSdkReleasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMobileSdkReleases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRegexPatternSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRegexPatternSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourcesForWebACLSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourcesForWebACL(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRuleGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRuleGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWebACLsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWebACLs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutLoggingConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutLoggingConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutManagedRuleSetVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutManagedRuleSetVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutPermissionPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutPermissionPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIPSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIPSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateManagedRuleSetVersionExpiryDateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateManagedRuleSetVersionExpiryDate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRegexPatternSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRegexPatternSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRuleGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRuleGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWebACLSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWebACL(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/wellarchitected/generated.json b/service/wellarchitected/generated.json index 6f94ee2f87c..88eff757fb2 100644 --- a/service/wellarchitected/generated.json +++ b/service/wellarchitected/generated.json @@ -93,6 +93,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/wellarchitected/sra_operation_order_test.go b/service/wellarchitected/sra_operation_order_test.go new file mode 100644 index 00000000000..6735e1ba540 --- /dev/null +++ b/service/wellarchitected/sra_operation_order_test.go @@ -0,0 +1,2541 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateLensesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateLenses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLensShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLensShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLensVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLensVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMilestoneSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMilestone(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateProfileShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateProfileShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateReviewTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateReviewTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTemplateShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTemplateShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorkloadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorkload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorkloadShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorkloadShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLensSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLens(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLensShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLensShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteProfileShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteProfileShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteReviewTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteReviewTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTemplateShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTemplateShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWorkloadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWorkload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWorkloadShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWorkloadShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateLensesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateLenses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExportLensSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExportLens(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAnswerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAnswer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetConsolidatedReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetConsolidatedReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGlobalSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGlobalSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLensSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLens(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLensReviewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLensReview(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLensReviewReportSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLensReviewReport(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetLensVersionDifferenceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetLensVersionDifference(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMilestoneSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMilestone(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetProfileTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetProfileTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReviewTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReviewTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReviewTemplateAnswerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReviewTemplateAnswer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetReviewTemplateLensReviewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetReviewTemplateLensReview(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetWorkloadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetWorkload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportLensSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportLens(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAnswersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAnswers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCheckDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCheckDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListCheckSummariesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListCheckSummaries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLensesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLenses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLensReviewImprovementsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLensReviewImprovements(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLensReviewsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLensReviews(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListLensSharesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListLensShares(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMilestonesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMilestones(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNotificationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNotifications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProfileNotificationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProfileNotifications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProfilesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProfiles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListProfileSharesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListProfileShares(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReviewTemplateAnswersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReviewTemplateAnswers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListReviewTemplatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListReviewTemplates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListShareInvitationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListShareInvitations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTemplateSharesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTemplateShares(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkloadsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkloads(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListWorkloadSharesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListWorkloadShares(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAnswerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAnswer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGlobalSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGlobalSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIntegrationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIntegration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateLensReviewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateLensReview(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateProfileSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateProfile(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateReviewTemplateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateReviewTemplate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateReviewTemplateAnswerSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateReviewTemplateAnswer(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateReviewTemplateLensReviewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateReviewTemplateLensReview(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateShareInvitationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateShareInvitation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWorkloadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWorkload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWorkloadShareSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWorkloadShare(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpgradeLensReviewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpgradeLensReview(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpgradeProfileVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpgradeProfileVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpgradeReviewTemplateLensReviewSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpgradeReviewTemplateLensReview(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/wisdom/generated.json b/service/wisdom/generated.json index b463e3a77ff..2a1c33099c4 100644 --- a/service/wisdom/generated.json +++ b/service/wisdom/generated.json @@ -62,6 +62,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/wisdom/sra_operation_order_test.go b/service/wisdom/sra_operation_order_test.go new file mode 100644 index 00000000000..6f0c6792673 --- /dev/null +++ b/service/wisdom/sra_operation_order_test.go @@ -0,0 +1,1456 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wisdom + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateAssistantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAssistant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAssistantAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAssistantAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateKnowledgeBaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateKnowledgeBase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateQuickResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateQuickResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAssistantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAssistant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAssistantAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAssistantAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteKnowledgeBaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteKnowledgeBase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteQuickResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteQuickResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAssistantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAssistant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAssistantAssociationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAssistantAssociation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetContentSummarySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetContentSummary(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetKnowledgeBaseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetKnowledgeBase(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetQuickResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetQuickResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRecommendationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRecommendations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssistantAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssistantAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAssistantsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAssistants(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListContentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListContents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListImportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListImportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListKnowledgeBasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListKnowledgeBases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListQuickResponsesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListQuickResponses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpNotifyRecommendationsReceivedSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.NotifyRecommendationsReceived(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpQueryAssistantSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.QueryAssistant(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveKnowledgeBaseTemplateUriSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveKnowledgeBaseTemplateUri(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchQuickResponsesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchQuickResponses(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchSessionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchSessions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartContentUploadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartContentUpload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartImportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartImportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateKnowledgeBaseTemplateUriSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateKnowledgeBaseTemplateUri(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateQuickResponseSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateQuickResponse(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/workdocs/generated.json b/service/workdocs/generated.json index 96daf64111e..c5dda3ed343 100644 --- a/service/workdocs/generated.json +++ b/service/workdocs/generated.json @@ -65,6 +65,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/workdocs/sra_operation_order_test.go b/service/workdocs/sra_operation_order_test.go new file mode 100644 index 00000000000..b2571c4982a --- /dev/null +++ b/service/workdocs/sra_operation_order_test.go @@ -0,0 +1,1561 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workdocs + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAbortDocumentVersionUploadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AbortDocumentVersionUpload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpActivateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ActivateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAddResourcePermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AddResourcePermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCommentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateComment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateCustomMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateCustomMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateFolderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateFolder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateLabelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateLabels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateNotificationSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNotificationSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeactivateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeactivateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCommentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteComment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteCustomMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteCustomMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDocumentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDocument(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDocumentVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDocumentVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFolderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFolder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteFolderContentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteFolderContents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteLabelsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteLabels(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNotificationSubscriptionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNotificationSubscription(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeActivitiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeActivities(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeCommentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeComments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeDocumentVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeDocumentVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeFolderContentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeFolderContents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeNotificationSubscriptionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeNotificationSubscriptions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeResourcePermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeResourcePermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeRootFoldersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeRootFolders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeUsersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeUsers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetCurrentUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetCurrentUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDocumentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDocument(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDocumentPathSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDocumentPath(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDocumentVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDocumentVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFolderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFolder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetFolderPathSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetFolderPath(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpInitiateDocumentVersionUploadSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.InitiateDocumentVersionUpload(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveAllResourcePermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveAllResourcePermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRemoveResourcePermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RemoveResourcePermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreDocumentVersionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreDocumentVersions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpSearchResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.SearchResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDocumentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDocument(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDocumentVersionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDocumentVersion(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateFolderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateFolder(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/workmail/generated.json b/service/workmail/generated.json index e9db21c9da6..63caae2d8b2 100644 --- a/service/workmail/generated.json +++ b/service/workmail/generated.json @@ -113,6 +113,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/workmail/sra_operation_order_test.go b/service/workmail/sra_operation_order_test.go new file mode 100644 index 00000000000..6e8eda58bd1 --- /dev/null +++ b/service/workmail/sra_operation_order_test.go @@ -0,0 +1,3241 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateDelegateToResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateDelegateToResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateMemberToGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateMemberToGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssumeImpersonationRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssumeImpersonationRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelMailboxExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelMailboxExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAvailabilityConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAvailabilityConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIdentityCenterApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIdentityCenterApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateImpersonationRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateImpersonationRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateMobileDeviceAccessRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateMobileDeviceAccessRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccessControlRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccessControlRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAvailabilityConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAvailabilityConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEmailMonitoringConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEmailMonitoringConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIdentityCenterApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIdentityCenterApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIdentityProviderConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIdentityProviderConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteImpersonationRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteImpersonationRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMailboxPermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMailboxPermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMobileDeviceAccessOverrideSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMobileDeviceAccessOverride(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteMobileDeviceAccessRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteMobileDeviceAccessRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePersonalAccessTokenSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePersonalAccessToken(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteRetentionPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteRetentionPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterFromWorkMailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterFromWorkMail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterMailDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterMailDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEmailMonitoringConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEmailMonitoringConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeEntitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeEntity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIdentityProviderConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIdentityProviderConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeInboundDmarcSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeInboundDmarcSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeMailboxExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeMailboxExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeOrganizationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeOrganization(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateDelegateFromResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateDelegateFromResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateMemberFromGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateMemberFromGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccessControlEffectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccessControlEffect(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDefaultRetentionPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDefaultRetentionPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetImpersonationRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetImpersonationRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetImpersonationRoleEffectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetImpersonationRoleEffect(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMailboxDetailsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMailboxDetails(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMailDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMailDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMobileDeviceAccessEffectSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMobileDeviceAccessEffect(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetMobileDeviceAccessOverrideSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetMobileDeviceAccessOverride(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPersonalAccessTokenMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPersonalAccessTokenMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccessControlRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccessControlRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAliasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAliases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAvailabilityConfigurationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAvailabilityConfigurations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGroupMembersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGroupMembers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListGroupsForEntitySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListGroupsForEntity(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListImpersonationRolesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListImpersonationRoles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMailboxExportJobsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMailboxExportJobs(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMailboxPermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMailboxPermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMailDomainsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMailDomains(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMobileDeviceAccessOverridesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMobileDeviceAccessOverrides(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListMobileDeviceAccessRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListMobileDeviceAccessRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListOrganizationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListOrganizations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPersonalAccessTokensSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPersonalAccessTokens(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourceDelegatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourceDelegates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourcesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResources(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUsersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUsers(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutAccessControlRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutAccessControlRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutEmailMonitoringConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutEmailMonitoringConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutIdentityProviderConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutIdentityProviderConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutInboundDmarcSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutInboundDmarcSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutMailboxPermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutMailboxPermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutMobileDeviceAccessOverrideSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutMobileDeviceAccessOverride(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRetentionPolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRetentionPolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterMailDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterMailDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterToWorkMailSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterToWorkMail(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpResetPasswordSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ResetPassword(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartMailboxExportJobSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartMailboxExportJob(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTestAvailabilityConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TestAvailabilityConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateAvailabilityConfigurationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateAvailabilityConfiguration(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDefaultMailDomainSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDefaultMailDomain(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateImpersonationRoleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateImpersonationRole(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMailboxQuotaSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMailboxQuota(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateMobileDeviceAccessRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateMobileDeviceAccessRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePrimaryEmailAddressSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePrimaryEmailAddress(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUser(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/workmailmessageflow/generated.json b/service/workmailmessageflow/generated.json index 1163eddd0b9..8f06cab2c79 100644 --- a/service/workmailmessageflow/generated.json +++ b/service/workmailmessageflow/generated.json @@ -23,6 +23,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/errors.go", "types/types.go", "validators.go" diff --git a/service/workmailmessageflow/sra_operation_order_test.go b/service/workmailmessageflow/sra_operation_order_test.go new file mode 100644 index 00000000000..608a5158120 --- /dev/null +++ b/service/workmailmessageflow/sra_operation_order_test.go @@ -0,0 +1,91 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmailmessageflow + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpGetRawMessageContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRawMessageContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutRawMessageContentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutRawMessageContent(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/workspaces/generated.json b/service/workspaces/generated.json index acaed45f5fb..51858562e75 100644 --- a/service/workspaces/generated.json +++ b/service/workspaces/generated.json @@ -109,6 +109,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/workspaces/sra_operation_order_test.go b/service/workspaces/sra_operation_order_test.go new file mode 100644 index 00000000000..0b1b6041031 --- /dev/null +++ b/service/workspaces/sra_operation_order_test.go @@ -0,0 +1,3101 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspaces + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAcceptAccountLinkInvitationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AcceptAccountLinkInvitation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateConnectionAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateConnectionAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateIpGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateIpGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateWorkspaceApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateWorkspaceApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAuthorizeIpRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AuthorizeIpRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCopyWorkspaceImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CopyWorkspaceImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateAccountLinkInvitationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateAccountLinkInvitation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConnectClientAddInSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConnectClientAddIn(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateConnectionAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateConnectionAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIpGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIpGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateStandbyWorkspacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateStandbyWorkspaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUpdatedWorkspaceImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUpdatedWorkspaceImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorkspaceBundleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorkspaceBundle(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorkspaceImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorkspaceImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorkspacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorkspaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateWorkspacesPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateWorkspacesPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteAccountLinkInvitationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteAccountLinkInvitation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteClientBrandingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteClientBranding(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConnectClientAddInSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConnectClientAddIn(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteConnectionAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteConnectionAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIpGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIpGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWorkspaceBundleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWorkspaceBundle(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteWorkspaceImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteWorkspaceImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeployWorkspaceApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeployWorkspaceApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterWorkspaceDirectorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterWorkspaceDirectory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeAccountModificationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeAccountModifications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeApplicationAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeApplicationAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeApplicationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeApplications(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeBundleAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeBundleAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClientBrandingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeClientBranding(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeClientPropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeClientProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConnectClientAddInsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConnectClientAddIns(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConnectionAliasesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConnectionAliases(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeConnectionAliasPermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeConnectionAliasPermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeImageAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeImageAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeIpGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeIpGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeTagsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeTags(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWorkspaceAssociationsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWorkspaceAssociations(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWorkspaceBundlesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWorkspaceBundles(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWorkspaceDirectoriesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWorkspaceDirectories(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWorkspaceImagePermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWorkspaceImagePermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWorkspaceImagesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWorkspaceImages(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWorkspacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWorkspaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWorkspacesConnectionStatusSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWorkspacesConnectionStatus(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWorkspaceSnapshotsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWorkspaceSnapshots(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWorkspacesPoolsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWorkspacesPools(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDescribeWorkspacesPoolSessionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DescribeWorkspacesPoolSessions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateConnectionAliasSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateConnectionAlias(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateIpGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateIpGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateWorkspaceApplicationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateWorkspaceApplication(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetAccountLinkSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetAccountLink(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportClientBrandingSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportClientBranding(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpImportWorkspaceImageSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ImportWorkspaceImage(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAccountLinksSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAccountLinks(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListAvailableManagementCidrRangesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListAvailableManagementCidrRanges(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpMigrateWorkspaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.MigrateWorkspace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyAccountSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyAccount(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyCertificateBasedAuthPropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyCertificateBasedAuthProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyClientPropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyClientProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifySamlPropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifySamlProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifySelfservicePermissionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifySelfservicePermissions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyStreamingPropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyStreamingProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyWorkspaceAccessPropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyWorkspaceAccessProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyWorkspaceCreationPropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyWorkspaceCreationProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyWorkspacePropertiesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyWorkspaceProperties(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpModifyWorkspaceStateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ModifyWorkspaceState(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRebootWorkspacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RebootWorkspaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRebuildWorkspacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RebuildWorkspaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRegisterWorkspaceDirectorySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RegisterWorkspaceDirectory(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRejectAccountLinkInvitationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RejectAccountLinkInvitation(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRestoreWorkspaceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RestoreWorkspace(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpRevokeIpRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.RevokeIpRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartWorkspacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartWorkspaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartWorkspacesPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartWorkspacesPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopWorkspacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopWorkspaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStopWorkspacesPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StopWorkspacesPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTerminateWorkspacesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TerminateWorkspaces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTerminateWorkspacesPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TerminateWorkspacesPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTerminateWorkspacesPoolSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TerminateWorkspacesPoolSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConnectClientAddInSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConnectClientAddIn(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateConnectionAliasPermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateConnectionAliasPermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateRulesOfIpGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateRulesOfIpGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWorkspaceBundleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWorkspaceBundle(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWorkspaceImagePermissionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWorkspaceImagePermission(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateWorkspacesPoolSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateWorkspacesPool(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/workspacesthinclient/generated.json b/service/workspacesthinclient/generated.json index 98b2e4d4b3e..daf7aaa7c6e 100644 --- a/service/workspacesthinclient/generated.json +++ b/service/workspacesthinclient/generated.json @@ -37,6 +37,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/workspacesthinclient/sra_operation_order_test.go b/service/workspacesthinclient/sra_operation_order_test.go new file mode 100644 index 00000000000..17125799182 --- /dev/null +++ b/service/workspacesthinclient/sra_operation_order_test.go @@ -0,0 +1,581 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspacesthinclient + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpCreateEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeregisterDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeregisterDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSoftwareSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSoftwareSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDevicesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDevices(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListEnvironmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListEnvironments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSoftwareSetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSoftwareSets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDeviceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDevice(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateEnvironmentSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateEnvironment(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSoftwareSetSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSoftwareSet(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/workspacesweb/generated.json b/service/workspacesweb/generated.json index 567fc45b352..449c319d634 100644 --- a/service/workspacesweb/generated.json +++ b/service/workspacesweb/generated.json @@ -89,6 +89,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/workspacesweb/sra_operation_order_test.go b/service/workspacesweb/sra_operation_order_test.go new file mode 100644 index 00000000000..f5a83b95718 --- /dev/null +++ b/service/workspacesweb/sra_operation_order_test.go @@ -0,0 +1,2401 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workspacesweb + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpAssociateBrowserSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateBrowserSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateDataProtectionSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateDataProtectionSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateIpAccessSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateIpAccessSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateNetworkSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateNetworkSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateTrustStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateTrustStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateUserAccessLoggingSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateUserAccessLoggingSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpAssociateUserSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.AssociateUserSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateBrowserSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateBrowserSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateDataProtectionSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateDataProtectionSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIdentityProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIdentityProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateIpAccessSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateIpAccessSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateNetworkSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateNetworkSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreatePortalSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreatePortal(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateTrustStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateTrustStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUserAccessLoggingSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUserAccessLoggingSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateUserSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateUserSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteBrowserSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteBrowserSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteDataProtectionSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteDataProtectionSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIdentityProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIdentityProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteIpAccessSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteIpAccessSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteNetworkSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteNetworkSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeletePortalSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeletePortal(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteTrustStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteTrustStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserAccessLoggingSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUserAccessLoggingSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteUserSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteUserSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateBrowserSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateBrowserSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateDataProtectionSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateDataProtectionSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateIpAccessSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateIpAccessSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateNetworkSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateNetworkSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateTrustStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateTrustStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateUserAccessLoggingSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateUserAccessLoggingSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDisassociateUserSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DisassociateUserSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpExpireSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ExpireSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetBrowserSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetBrowserSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetDataProtectionSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetDataProtectionSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIdentityProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIdentityProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIpAccessSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIpAccessSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetNetworkSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetNetworkSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPortalSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPortal(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetPortalServiceProviderMetadataSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetPortalServiceProviderMetadata(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSessionSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSession(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTrustStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTrustStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTrustStoreCertificateSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTrustStoreCertificate(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUserAccessLoggingSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUserAccessLoggingSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetUserSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetUserSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListBrowserSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListBrowserSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListDataProtectionSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListDataProtectionSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIdentityProvidersSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIdentityProviders(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListIpAccessSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListIpAccessSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListNetworkSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListNetworkSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListPortalsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListPortals(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListSessionsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListSessions(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTrustStoreCertificatesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTrustStoreCertificates(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTrustStoresSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTrustStores(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUserAccessLoggingSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUserAccessLoggingSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListUserSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListUserSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateBrowserSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateBrowserSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateDataProtectionSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateDataProtectionSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIdentityProviderSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIdentityProvider(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIpAccessSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIpAccessSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateNetworkSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateNetworkSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdatePortalSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdatePortal(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTrustStoreSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTrustStore(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserAccessLoggingSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUserAccessLoggingSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateUserSettingsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateUserSettings(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} diff --git a/service/xray/generated.json b/service/xray/generated.json index 1fdd138eeed..b64a786592a 100644 --- a/service/xray/generated.json +++ b/service/xray/generated.json @@ -59,6 +59,7 @@ "protocol_test.go", "serializers.go", "snapshot_test.go", + "sra_operation_order_test.go", "types/enums.go", "types/errors.go", "types/types.go", diff --git a/service/xray/sra_operation_order_test.go b/service/xray/sra_operation_order_test.go new file mode 100644 index 00000000000..c31964b89c3 --- /dev/null +++ b/service/xray/sra_operation_order_test.go @@ -0,0 +1,1351 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package xray + +import ( + "context" + "errors" + "github.com/aws/smithy-go/middleware" + "slices" + "strings" + "testing" +) + +var errTestReturnEarly = errors.New("errTestReturnEarly") + +func captureMiddlewareStack(stack *middleware.Stack) func(*middleware.Stack) error { + return func(inner *middleware.Stack) error { + *stack = *inner + return errTestReturnEarly + } +} +func TestOpBatchGetTracesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.BatchGetTraces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCancelTraceRetrievalSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CancelTraceRetrieval(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpCreateSamplingRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.CreateSamplingRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpDeleteSamplingRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.DeleteSamplingRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetEncryptionConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetEncryptionConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetGroupsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetGroups(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetIndexingRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetIndexingRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInsightSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInsight(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInsightEventsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInsightEvents(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInsightImpactGraphSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInsightImpactGraph(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetInsightSummariesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetInsightSummaries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetRetrievedTracesGraphSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetRetrievedTracesGraph(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSamplingRulesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSamplingRules(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSamplingStatisticSummariesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSamplingStatisticSummaries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetSamplingTargetsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetSamplingTargets(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetServiceGraphSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetServiceGraph(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTimeSeriesServiceStatisticsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTimeSeriesServiceStatistics(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTraceGraphSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTraceGraph(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTraceSegmentDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTraceSegmentDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpGetTraceSummariesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.GetTraceSummaries(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListResourcePoliciesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListResourcePolicies(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListRetrievedTracesSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListRetrievedTraces(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpListTagsForResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.ListTagsForResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutEncryptionConfigSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutEncryptionConfig(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutResourcePolicySRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutResourcePolicy(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutTelemetryRecordsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutTelemetryRecords(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpPutTraceSegmentsSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.PutTraceSegments(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpStartTraceRetrievalSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.StartTraceRetrieval(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpTagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.TagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUntagResourceSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UntagResource(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateGroupSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateGroup(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateIndexingRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateIndexingRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateSamplingRuleSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateSamplingRule(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +} +func TestOpUpdateTraceSegmentDestinationSRAOperationOrder(t *testing.T) { + expect := []string{ + "OperationSerializer", + "Retry", + "ResolveAuthScheme", + "GetIdentity", + "ResolveEndpointV2", + "Signing", + "OperationDeserializer", + } + + var captured middleware.Stack + svc := New(Options{ + APIOptions: []func(*middleware.Stack) error{ + captureMiddlewareStack(&captured), + }, + }) + _, err := svc.UpdateTraceSegmentDestination(context.Background(), nil) + if err != nil && !errors.Is(err, errTestReturnEarly) { + t.Fatalf("unexpected error: %v", err) + } + + var actual, all []string + for _, step := range strings.Split(captured.String(), "\n") { + trimmed := strings.TrimSpace(step) + all = append(all, trimmed) + if slices.Contains(expect, trimmed) { + actual = append(actual, trimmed) + } + } + + if !slices.Equal(expect, actual) { + t.Errorf("order mismatch:\nexpect: %v\nactual: %v\nall: %v", expect, actual, all) + } +}